Archived

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

transparency with alpha channel

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

Im trying to implement half-life like ladders, windows, detailed objects etc. using alpha channel transparency.(I need holes in the textures). If I create two different textures both RGB, I can do it. But when I try to utilize the alpha channel, I fail. Does anyone know how to implement this using OpenGL?

Share this post


Link to post
Share on other sites
try this :
  
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);


Note that when you load the image with the alpha channel, you must make sure that the third parameter in glTexImage2D matches
your format (in the case of a 32bit alpha channel .tga that would be GL_RGBA8)


Feel free to email me.

Share this post


Link to post
Share on other sites