Combine and rebuild depth from two render passes viewPos.z && (depth2-0.0001>0.0)) discard; vec4 image = texture2DRect(tex_color, texcoord0); gl_FragColor = vec4(image.rgb, 0); } ]]>