Jump to content

Z culling

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by ToohrVyk (talk | contribs) at 21:16, 19 May 2006. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

In Rendering (computer graphics), Z culling refers to early pixel elimination based on depth, a method that provides an increase in performance when rendering of hidden surfaces is costly. It is a direct consequence of Z-buffering, where the depth of each pixel candidate is compared to the depth of existing geometry behind which it might be hidden.

When using a Z-buffer, a pixel can be culled (discarded) as soon as its depth is known, which makes it possible to skip the entire process of lighting and texturing a pixel that would not be visible anyway. Also, time-consuming pixel shaders will generally not be executed for the culled pixels. This makes Z culling a good optimization candidate in sitations where Fillrate, lighting, texturing or pixel shaders are the main bottlenecks.

While Z-buffering allows the geometry to be unsorted, sorting polygons by increasing depth (thus using a reverse Painter's algorithm) allows each screen pixel to be rendered to only once. This can increase performance in fillrate-limited scenes with large amounts of overdraw.