GL_CONSTANT_ALPHA ??

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
booltox
Posts: 7
Joined: Thu Nov 05, 2009 5:35 am

GL_CONSTANT_ALPHA ??

Post by booltox »

Greetings All,

I wasn't able to find this topic in the forum so I'm hoping that somebody might know if there is an irrlicht material system equivalent way of dealing with the following code:

Code: Select all

        glEnable(GL_BLEND);
        glBlendFunc(GL_CONSTANT_ALPHA, GL_CONSTANT_ALPHA);
        glBlendColor(1.0f, 1.0f, 1.0f, 0.5f);
        
        glEnable(GL_ALPHA_TEST);
        glAlphaFunc(GL_GREATER, 0);

Im pretty sure I know the answer, that EMT_ONETEXTURE_BLEND is not capable of handling this, but I just want to make sure Im not missing something.

Thanks
-b
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

We haven't added this to Irrlicht so far. You'd need to add a new material, or add a material parameter (the latter would require larger changes of the engine, though, while the former is possible from user code).
booltox
Posts: 7
Joined: Thu Nov 05, 2009 5:35 am

Post by booltox »

hybrid wrote:We haven't added this to Irrlicht so far. You'd need to add a new material, or add a material parameter (the latter would require larger changes of the engine, though, while the former is possible from user code).

Thanks for answering.

If I was to add a new material, would setting the BlendFunc in the OnSetConstants() call work best?

Thanks,
-b
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

OnSetConstants is only available for shader materials. You should encode this value into MaterialTypeParam as done in OneTextureBlend.
Post Reply