glTexEnvfv()

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

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.

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.

Ok, thanks a lot…
Even though it seemed too hard

/goater