A depth buffer stores a depth value for each covered framebuffer sample so that rasterization can resolve visibility. With the common “less” comparison, a new fragment contributes only when its depth is smaller than the stored value; an accepted fragment can then update that value. Thus the nearest opaque surface can win even when primitives arrive in a different order.[ref]
For example, starting from depth 1, an opaque fragment at 0.7 passes, then one at 0.2 replaces it; a later fragment at 0.8 fails. Reversing the first two arrivals gives the same visible surface. Finite precision can make nearly coincident surfaces compare inconsistently. Transparent surfaces also require additional treatment: selecting one nearest depth alone cannot combine light from several layers.

Articles by others on the same topic (0)

There are currently no matching articles.