Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


how do I do transparency/translucency?

This topic is 5981 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

How do I render textures with transparent peices on to polygons?translucent textures would be useful to. I would very much appreciate a link to a tutorial, or, if it''s not to much code, a code snippet. Thanks for you guys'' on-going support, I have an actualy working demo now , transparency would make it look less drab though. Klaus

Share this post

Link to post
Share on other sites
To do transparency, youll want to look into using glAlphaFunc and glEnable(GL_ALPHA_TEST). The images you want to have transparent areas must be 32bit, with the last 8 bits being the alpha values (which you can configure to be transparent using glAlphaFunc).

For translucancy, glEnable(GL_BLEND) and glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA) are used to enable standard translucancy, and you can change the amount of translucency with glColor4f(r,g,b,A) where A is the level of translucancy (1 == solid, 0 = invisible, 0.5 == semi-translucent).

Hope that helps a bit.

"When I have a problem on an Nvidia, I assume that it is my fault. With anyone else''s drivers, I assume it is their fault" - John Carmack

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!