Page 1 of 1

GL_CONSTANT_ALPHA ??

Posted: Mon Jan 04, 2010 7:13 pm
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

Posted: Mon Jan 04, 2010 8:01 pm
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).

Posted: Mon Jan 04, 2010 8:36 pm
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

Posted: Mon Jan 04, 2010 11:15 pm
by hybrid
OnSetConstants is only available for shader materials. You should encode this value into MaterialTypeParam as done in OneTextureBlend.