View Full Version : Displaying transparencies with targa images
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.
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).
Thanks for that I will try it
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.