Nvidia Simple Depth Float tutorial

I am trying to add the Nvidia “Simple Depth Float Buffer” tutorial to my Cascading Shadowmapping, where you use GL_DEPTH_COMPONENT32F_NV and flip the depth buffer around

After looking at the demo more closely, if the near plane is say 1.0 vs. some crazy amount like .001 or so I can’t see any Z fighting… So is this really only useful in extreme conditions?


This is a well known fact, the amount of z-fighting is largely dependent on the z-near to z-far ratio, also on how close two parallel polygons are.
Though i have to admit i would like to have a double precision float z buffer.

I would to. I knew that near to far ratio was the most important, the further out you can move the near the better. I was hoping that the extension would help shadowmapping issues, but if the planes are already moved out far enough then this isn’t helping either unless you have extremely small near planes.

Re near to far ratio being key… I’ve heard that theory before. However, you can push your far clip out to “infinity” (to solve shadow volume far plane clipping issues, for instance), and while near/far = 0 (implying that this does really nasty things to Z precision), in practice it doesn’t hurt your Z precision much at all. Seems to discount that theory.

Near plane’s the big fish. Far plane, …not so much. All your precision is clustered up against the near plane. Its magnitude is key.

Well in when it comes to shadow volumes it does not have z fighting issues, the z-near/z-far ratio issue only affects things that are far away, also then only on geometry that are close together, especially parallel planes.
While it’s true that the far plane does less to z fighting than the near plane, but it does move the barrier of which some problems start to appear (especially around edges), and not a lot of that is pure z fighting as some of it looks more like bad aliasing.

The same plane z-fighting you get when you have two polygons that share the same plane but are offset to each other or another size are not diminished by either changing the z-near, z-far or the precision of the depth buffer, it only changes appearance slightly.

all types of z-fighting are easier to remove using smart geometry modeling and texturing rather than adjusting the rendering methods (though you should keep the z clip planes within sane values).