Matthew Wahab
03-25-2008, 11:09 AM
Hi,
I'm trying to pass RGB texture data to OpenGL and have it internally represented as GL_ALPHA.
ex. Alpha = x*R + y*G + z*B, where x,y,z are some constants
I've tried:
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, w, h, 0, GL_ALPHA, GL_UNSIGNED_BYTE, data);
but don't get the correct results.
Also, I know I can do this easily by iterating over each pixel and converting them myself but want to avoid the CPU overhead if possible.
Help!!
(NOTE: I can't use shaders, this has to be done with the fixed-function pipeline)
I'm trying to pass RGB texture data to OpenGL and have it internally represented as GL_ALPHA.
ex. Alpha = x*R + y*G + z*B, where x,y,z are some constants
I've tried:
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, w, h, 0, GL_ALPHA, GL_UNSIGNED_BYTE, data);
but don't get the correct results.
Also, I know I can do this easily by iterating over each pixel and converting them myself but want to avoid the CPU overhead if possible.
Help!!
(NOTE: I can't use shaders, this has to be done with the fixed-function pipeline)