Depth peeling problem

Hi,

I have downloaded the source code of Front2Back Peeling from NVIDIA SDK 10.5 (Dual Depth peeling project). This code works perfectly on my GTX 295 with the last drivers.

But when I adjusted this code to my project, i can only produce the first layer of any model (color and depth textures). This happens due to bit-exact comparison between FP32 z-buffer and fragment depth is always true (at the computation step of the second layer). So, all fragments are discarded:


if (gl_FragCoord.z <= textureRect(texture_depth, gl_FragCoord.xy).r) discard;

I have made several modifications to find where the problem is and achieve to generate the second layer by changing the if condition : (but i cannot compute any other layer)


if (gl_FragCoord.z == textureRect(texture_depth, gl_FragCoord.xy).r) discard;

I have read all the relative posts on this forum and i didn’t manage to solve it.

I solved it. My mistake. I didn’t pass the ‘texture_depth’ texture uniform in the first peeling…never mind.