Hi
I’m writing a WinNT program to render grayscale images using glDrawPixels and texturing.
The user can switch between these two methods with a control.
In order to control brightness, contrast, and gamma, I generate a 256-element GLfloat
array of remapping values called Map, and then apply Map using the following:
glPixelTransferi ( GL_MAP_COLOR, GL_TRUE );
glPixelMapfv ( GL_PIXEL_MAP_R_TO_R, 256, Map );
glPixelMapfv ( GL_PIXEL_MAP_B_TO_B, 256, Map );
glPixelMapfv ( GL_PIXEL_MAP_G_TO_G, 256, Map );
This works fine with glDrawPixels, but has no effect when using texturing.
I’m using gluBuild2DMipmaps to load my images into texture memory. These images are
typically 1024 X 1024 or 2048 X 2048 LUMINANCE values.
During initialization, I have tried GL_DECAL, GL_BLEND, and GL_MODULATE with
glTexEnvi ( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, XX ), to no avail.
When I did this on SGI machines, I used glColorTableSGI, which worked great, but
now I’m forced to use this #*!/& PC, which does not have SGI’s extensions to OpenGL.
The references all say that texturing and pixel mapping should both behave the same
regarding pixel transfer modes. Suggestions anyone?