“Saving the z-cull optimization” by Mantler and Hadwiger

  • ©Stephan Mantler and Markus Hadwiger




    Saving the z-cull optimization



    Modern graphics hardware employs z-culling, or early-z culling, as a conservative z-test before the actual per-fragment z-test [Kilgariff and Fernando 2005]. Z-culling is used to avoid executing expensive fragment shaders for invisible fragments, and minimize reading, testing, and updating z-buffer entries. However, these optimizations need to be disabled for shaders that modify the z value of a fragment (depth replace). Such shaders are rapidly gaining in importance, however, especially in the context of per-pixel displacement mapping such as relief mapping [Policarpo et al. 2005]. We propose a slight modification to graphics APIs and hardware drivers that would allow to retain many of the z-cull optimizations for a large class of depth-modifying shaders, including displacement shaders. The basic idea is for shaders to specify a non-negative depth offset that is added to the z value of the fragment. While the exact z value is not known before the shader is executed, the lower bound is sufficient to perform all z-culling tests. Updates to the z-cull buffer are limited, but not worse than with texkill shaders.


    1. Hasselgren, J., and Akenine-Möller, T. 2006. Efficient Depth Buffer Compression. In Proceedings of Graphics Hardware 2006, 103–110.
    2. Kilgariff, E., and Fernando, R. 2005. The GeForce 6 Series GPU Architecture. In GPU Gems 2, Addison-Wesley Professional, M. Pharr, Ed., 471–491.
    3. Policarpo, F., Oliveira, M. M., and Comba, J. L. D. 2005. Real-time relief mapping on arbitrary polygonal surfaces. In Proceedings of 2005 Symposium on Interactive 3D Graphics and Games, 155–162.

ACM Digital Library Publication:

Overview Page: