Advertisement Jump to content


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


OpenGL How to do transparent textures in OpenGL?

This topic is 6714 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
Hi there,

This is the code i use to do this

void __fastcall TEngine::Render()
//render facelists



if(blended_faces) {


//re-enable depth buffer write

//before clear or it wont be cleared


//delete facelists

opaque_faces = NULL;
cur_opaque = NULL;
blended_faces = NULL;
cur_blended = NULL;

the faces are added to 2 linked lists one opaque one transparent
render the opaque first set the depth buffer to read only then
render the transparent.

Hope this helps.


Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!