as the title says, I'm trying to access material flags in my opengl shader.
The reason why I'm trying this is as follows:
I have a shader for making an effect from completely invisible --> transparent --> visible for multiple objects.
But now I want to use the same shader for the inverted effect (visible --> transparent --> completly invisible)
Well the problem here is:
I have a variable alpha in MyShaderCallBack with
Code: Select all
services->setPixelShaderConstant("alpha", &alpha, 1);
if(lower)
alpha -= 0.025;
else
alpha += 0.025;But if I want to make one object become visible, while the other one becomes invisible, well I would need an object specific flag to pass to the shader.
So I would be able to set the alpha or the inverse of the alpha value.
Code: Select all
if(flag)
alpha = xy;
else alpha = 1 - xy; But maybe somebody knows a better method to acchieve what I want.
I would like to put this two effects in one shader because I read about limitations from the graphics card, something with 64 shaders per card.
Well, I don't know if I'll need that much, but who knows
I hope somebody can help me.
Thanks in advance and best regards
Ritti