David Thompson:
|>Is there a way to turn off lighting and just rasterize a polygon using it's
|>color component?
|
|You have to remove the normals component on the object. Then it won't
|know how to shade.
Tom Bartol:
|You can also use a "Shade" module and set the shade flag to false (which
|seems silly but it works).
Thanks for the replies. I'd tried those two approaches, but they
didn't work. More experimentation reveals that this is a bug in polygon
rendering.
With no normal and Shade(shade=0), my white polygon renders light gray
(#e9e9e9).
If I additionally set specular=0, shininess=0, diffuse=0, ambient=0
with shade=0, this produces a dark gray (#333333) polygon. So lighting
calculations are apparently still being performed on the polygon despite
the shade=0.
However, if I sub-in a Grid("rectangle") dataset for my polygon (same
image plane), keeping these same Shade settings, the rectangle renders
white (...well ok, not "really" white, but close: #fefefe).
Randy
P.S. FWIW, what I'm really trying to do is clip an image to a polygon,
marking pixels outside the polygon as invalid positions. Originally I
tried Map to do the clipping (i.e. creating invalid positions), which
works but is "very, very" slow -- I'm clipping megapixel image grids
to a single multi-thousand edge polygon). As a performance
workaround, I'm rasterizing the polygon in white on a black image grid
with the same geometry as the image and using Overlay to clip the
image. The trick now is to get the polygon to rasterize using a known
color.
I know I could have just hacked Render's output with a Mark("colors")
-> Compute -> Unmark to get my color, but I wanted to understand why
the Render's color was wrong first.
--
Randall Hopper (mailto:[EMAIL PROTECTED])
Lockheed Martin Operation Support
EPA Scientific Visualization Center
US EPA MD/24 ERC-1A; RTP, NC 27711