View Full Version : glPixelTransfer won't work with texturing

05-30-2000, 10:43 AM

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?

05-30-2000, 02:12 PM
what i know is that when you use textures (ie, draw primitives with texturing enabled) opengl does not carry on pixel transfer operations.

instead pixel transfer ops act with texturing only when you upload or download them with glTexImage.