Jump to content
  • Advertisement

Archived

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

monkeyman

How to do transparent textures in OpenGL?

This topic is 6530 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

I''ve got the alpha values set in my texture..I''ve got the code that enables the alpha test when using a transparent texture..I don''t need to do any blending, I just need to see through certain parts of the texture..I''ve manually set the alpha values in the texture to 1''s and 0''s, so that''s ready to go..I found a good tutorial on NeHe''s site but it illustrates a double-pass system rather than using the alpha channel..I''m sure it''s something specific that I need to set with OpenGL before I can see the results, but I don''t know what...any suggestions? "Like all good things, it starts with a monkey.."

Share this post


Link to post
Share on other sites
Advertisement
glEnable(GL_ALPHA_TEST);
glAlphaFunc(GL_GREATER,0.5); // whatever

now every texel with a alpha less than 0.5 wont get draw on the screen
note alpha testing is quicker than doing blending

Share this post


Link to post
Share on other sites
glEnable(GL_ALPHA_TEST);
glAlphaFunc(GL_GREATER,0.5);

this is exactly what I have already..I think I need to rip apart the TGA loader and double check my alpha values..more fun

"Like all good things, it starts with a monkey.."

Share this post


Link to post
Share on other sites
I’m just a newbie who can barely set up a proper polygon , but nevertheless I hope I can help. You should check out Nehe’s tutorials in the OpenGl section, lesson 8 deals exactly with transparent textures.

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!