PDA

View Full Version : Transparency in textures



BwB
08-13-2000, 02:47 AM
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 http://www.opengl.org/discussion_boards/ubb/smile.gif

Thanks in advance - BwB

DPalomo
08-13-2000, 03:02 AM
Hi,

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 http://nate.scuzzy.net/gltut/
for both techniques.

Hope this helps,

Daniel Palomo van Es

BwB
08-13-2000, 05:00 AM
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 http://www.opengl.org/discussion_boards/ubb/smile.gif

Simon
08-13-2000, 11:49 AM
You can use simple bmps with a black background check out nehes tutorials -> http://nehe.gamedev.net/tutorials/lesson09.asp