Nathan Reed recently published a blog article plotting his numerical findings of Z-buffer precision under different uses. On the way he references a couple of previous articles, that also reference other resources; I think it’s a good opportunity to list some of them. They all tell a part of the story and I recommend reading all of them to get the complete picture.
- A couple of notes about Z, 2009, by Emil Persson, on why Z-buffer is non linear and how to counter the loss of precision.
- Attack of the depth buffer, 2010, by Matt Pettineo, on visualizing depth buffer error when using different buffer formats.
- Maximizing Depth Buffer Range and Precision, 2012, by Brano Kemen, with a significant part on how OpenGL and DirectX are differently affected by the precision issue (spoiler: OpenGL’s coordinate convention hurts pretty badly in this case; fortunately as Nathan Reed’s article points, an extension now fixes this).
- Depth Precision Visualized, 2015, by Nathan Reed, on visualizing depth buffer precision as a function of distance, when using different buffer formats and Z representations.