PDA

View Full Version : glTexEnvfv()



goater
07-03-2001, 05:52 AM
Hi.
Are there any way to obtain transparency using glTexEnvfv()?
I tried glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, myRGBA_Array)
where the array was {0.0f,0.0f,1.0f,0.0f}which i think would make blue transparent...
but i doesn't work...
Could anyone help me???

goater

DFrey
07-03-2001, 06:03 AM
Nope, all that did was set the texture environment color. And what you want is to configure color keying. But standard OpenGL does not support color keying. You must write code yourself that will change the color key pixels to transparent pixels (alpha=0) and other pixels to opaque (alpha=1.0). And then you must use alpha testing when drawing with that texture.

DFrey
07-03-2001, 06:06 AM
Clarification: You must write code that will convert your RGB texture data to RGBA texture data, and upload the RGBA version with OpenGL. And also the 1.0 in (alpha=1.0) is the normalized alpha value. In the texture data, if you are using unsigned bytes, that would be 255.

goater
07-03-2001, 06:08 AM
Ok, thanks a lot...
Even though it seemed too hard http://www.opengl.org/discussion_boards/ubb/frown.gif

/goater