Transparency in textures

Is there any easy way to tell OpenGL not to render the black pixels in a texture (making black transparent)? Or should I just go with an alpha test (requiring the texture to have an alpha channel)?

My current situation is this: I want to render the bars of a jail cell as one quad. The texture has black in between each bar. Sounds easy enough… Texture is 24bpp currently so no color index tricks

Thanks in advance - BwB


I always go for the alpha channel transparency with 32-bits TGA textures. But it’s also possible to use color keying (=choose a color to make transparent).

You should check
for both techniques.

Hope this helps,

Daniel Palomo van Es

Thanks DPalomo!
That site was just what I was looking for. I plan to eventually switch to the alpha channel method, but I wanted to get this working quickly so I didnt have to try to screw with the data I already have

You can use simple bmps with a black background check out nehes tutorials ->