PDA

View Full Version : intensity -> color table -> intensity?



G-Force
08-15-2002, 12:45 PM
How can I use all of the channels (RGBA) in the color table for scalar textures (Intensity)? When I use the following:

glTexImage2D(GL_TEXTURE_2D, 0, GL_INTENSITY,
width, height, 0, GL_RGBA,
GL_UNSIGNED_BYTE, pixel);

glColorTable(GL_COLOR_TABLE, GL_RGBA, 256,
GL_RGBA, GL_UNSIGNED_BYTE, table);

I get intensity back, ie the red channel, and the output is thus black and white. Is there a way to do what I want which is to map a scalar texture value to a colour in a simple way without having to use a multi-pass technique?

bakery2k
08-15-2002, 01:23 PM
Look into the EXT_paletted_texture extension.
(Is this a core feature by now?)