# How to best utilize depth buffer precision

Are there strategies to minimize depth buffer precision problems with hyperbolic depth buffers, such as the ones resulting from perspective projection matrices, or depth buffers in general?

For example, graphics APIs usually give an option to change the depth range, which might influence precision. It's possible to linearize non-linear depth buffers, for whatever reason. There's the option of floating point depth buffers, and non-floating point depth buffers. It's possible that changing the information in projection matrices has a result on the resulting range & precision of the depth buffer.

How do all of these things interact with the resulting range & precision, or with each other, and how do I get the maximum out of my depth buffer? Are there general good practices one should adopt, regardless of project specifics?

• Just a quibble about terminology - the standard perspective projection depth buffer isn't logarithmic, but reciprocal (or sometimes called hyperbolic) - it's based on 1/z rather than log z. – Nathan Reed Feb 2 '14 at 20:44

As a capstone to this entire disucssion, you should consider the following article, because it discusses the ramifications of all of the representations I mentioned above in terms of re-constructing position from depth. The takeaway point is that inverse perspective depth (1 – Z/W, 32-bit floating point) is nearly as good as linear depth, and it still benefits from hardware Z-buffer optimizations.