gl_FragDepth problem

I’ve run into problems when trying to set the depth of a fragment using gl_FragDepth.
My aim is to offset the object to the front a bit while using a depthtest, as to achieve a ‘band’ similar as one would use polygon_offset.

However, gl_FragDepth behaves very strangely.
It renders ok when we would write:

gl_FragDepth = gl_FragCoord.z;

and it EVEN COMPILES AND RUNS when I say:

gl_FragDepth = gl_FragCoord.z + 1; // SHOULD GENERATE TYPE CAST ERROR

When I use:

gl_FragDepth = a;

with a between (0.0, 1.0) :slight_smile: gives always the same erroneous depthmap.

I got this strange behaviour under linux (driver 61.11) using a GeForce FX 5200.

thnx

I’m having the same problem on a gf6800 GT / winXP combination.

It appears that setting gl_FragDepth has no effect at all.

Nico

I’m on version 61.77 (win2k), same problem. I experienced it on GeForce FX as well as on 6800. Maybe it only happens in Belgium, though? :slight_smile:

I’ll contact NVidia and see if/when we can expect a fix.

– Tom

I’ve just installed 66.00, and the problem no longer seems to occur.

– Tom

Yep, everything seems to work fine now.
Thanks for the tip Tom :slight_smile:

Nico

That indeed is excellent news!
Is there any timeframe on when this fix would be available in the linux drivers?

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