vec2 duv = vec2(var_gl_position.xy + 1) / 2;
float depth = texture2D(tex1, duv).r;
if (gl_FragCoord.z > depth)
{
discard;
}
seems that works
vec2 duv = vec2(var_gl_position.xy + 1) / 2;
float depth = texture2D(tex1, duv).r;
if (gl_FragCoord.z > depth)
{
discard;
}
seems that works