PDA

View Full Version : Displaying transparencies with targa images



03-02-2004, 05:46 AM
I have targa images used as sprites but the background of the sprite is being shown even though it is transparent.

Please can someone please help me so that they are transparent.

Thanks

Relic
03-02-2004, 06:25 AM
With sprite you mean a textured quad?
Use an RGBA format, the alpha is the opacity in OpenGL speak. 1.0 means fully opaque, 0.0 means fully transparent. Put a 0 byte into all alpha values of your texture which should be transparent, put a 255 into the opaque ones.
Lookup the docs to glAlphaFunc, set its parameters to something like (GL_GREATER, 0) then glEnable(GL_ALPHA_TEST) and see how only the pixels are drawn which pass the test (alpha > 0).

03-03-2004, 06:05 AM
Thanks for that I will try it