I assumed that the other parts of the c++ code are correcly initialized, texture_rectangles for example. I believe don’t need modify anything, isn’t it?
void main()
{
vec4 tmp = textureRect(rt, gl_FragPos.xy);
// or use shadowRect or whatever texture function will do the depth compare for you
if(tmp.x - 0.5 < 0.0)
{
discard;
}
gl_FragColor = gl_Color;
}
your code was very close, but offsetting the texture lookup is a bug.
But, you might want to make sure that your shader is actually compiling and linking (by checking the infolog) because it also might sound like your hardware isn’t supporting something in the application (like the shader or rendertargets, etc.).
Originally posted by yalmar: Yes, i do it in the same way that ARB_fragment_program parameters.
You’re using glUniform*() calls, right? Not glProgramEnvParameter*ARB()?
Of course, for using offset in GLSL i used glUniform.
I implemented the glsl version for the layerz_3x demo, and it works fine, but in the oit_3x demo I no yet tested. I believe that works too.