PDA

View Full Version : Transparency in textures...



MrShoe
11-01-2001, 10:33 PM
I am trying to make it so that the black parts of my textures are transparent... But i now understand that it is not as simple as adding a 4th byte per pixel as an alpha channel and setting it to 0 when the pixel is black, 1 when the pixel isnt... and then changing the glTexImage2D function parameters a bit... I think that a particular alpha blending mode has to be entered but i have no idea... can somebody help me?

jabe
11-01-2001, 11:31 PM
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

and your internal texture format is now GL_RGBA (or GL_BGRA).

[This message has been edited by jabe (edited 11-02-2001).]

Omaha
11-03-2001, 08:39 PM
Would it be quicker to use alpha testing instead of blending? It wouldn't look as good if you filter the texture, though.