[fix] OpenGL in dev-cpp EMT_TRANSPARENT_ALPHA_CHANNEL

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
Pax
Posts: 12
Joined: Sat Apr 16, 2005 1:29 pm

[fix] OpenGL in dev-cpp EMT_TRANSPARENT_ALPHA_CHANNEL

Post by Pax »

Hi, for those having problems with EMT_TRANSPARENT_ALPHA_CHANNEL using devcpp OpenGL, I've found:

From COpenGLMaterialRenderer.h

in class

COpenGLMaterialRenderer_TRANSPARENT_ALPHA_CHANNEL

change:
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_COLOR);
for:
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);

Tried it on my machine (with Ati 9200 card) and did worked like the usual alpha matte instead of like "additive" mode mixed with different transparency. Used to correct:

http://irrlicht.sourceforge.net/phpBB2/ ... php?t=4083

Just draw semitransparent objects before solid ones.
Ciao.
Post Reply