Result.depth & gl_FragDepth

What is the difference between result.depth (ARB_fp) and gl_FragDepth (glsl)? The default value, calculated by the fixed function, for result.depth seems to be (fpos.z/fpos.w)*0.5+0.5 if fpos is the fragment position in clip coords. But the fixed function value for gl_FragDepth is fpos.z/fpos.w.
How can I emulate the fixed pipeline when writing to result.depth ? Thanks.

If you need position invariance for transform, you need to use the position invariant transform option in your vertex program/shader, and then, AFAICT, you need to not touch the depth value in your fragment program/shader.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.