Re: Question about using palettes with images and shader in object graphics [message #83272] |
Tue, 12 February 2013 12:13  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
M. Katz writes:
>
> Here I'll answer my own question definitively from the IDL Help on IDLgrImage (See the last line):
>
> PALETTE
> An object reference to a palette object (an instance of the IDLgrPalette object class) that specifies the red, green, and blue values of the color lookup table to be associated with the image if it is an indexed color image. This property is ignored if the image is a greyscale or RGB image.
>
> Note: This table is only used when the destination is an RGB model device. The Indexed color model writes the indices directly to the device. In order to ensure that these colors are used when the image is displayed, this palette must be copied to the graphics destination’s palette for any graphics destination that uses the Indexed color model.
>
> Note: If a SHADER is associated with the image object, the palette is ignored.
This seems to conflict with this statement, in the same documentation:
Note: If a PALETTE has been set, the palette lookup is done before the
fragment shader is executed. Therefore, when the fragment shader reads
from the image texture it will be passed 8-bit per channel RGB data
(read from the palette), not the original 1-channel image data.
Go figure. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
|
|
|