Archived

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

leblebi

transparency with alpha channel

Recommended Posts

leblebi    124
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
Lord Karnus    122
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