Z-fighting

From Wikipedia, the free encyclopedia

Coplanar polygons
Coplanar polygons

Z-fighting, also called stitching, is a phenomenon in 3D rendering that occurs when two or more coplanar primitives have similar values in the Z-buffer, causing random parts of the primitives to be rendered. This problem is usually caused by floating point round-off errors. Z-fighting is reduced by the use of a higher resolution depth buffer, by W-buffering, or by simply moving the polygons further apart.

It is a relatively rare occurrence to encounter z-fighting while using a 24-bit Z-buffer. For example, with a 16-bit Z-buffer, at 10,000 units, resolving accuracy is only 1,800 units, meaning a point at 18,000 units away from the camera is given the same Z-buffer value as a point 11,799 units away. For comparison, resolving accuracy for a 24-bit Z-buffer is 6 units at the same distance.

As virtual world size increases, a greater likelihood exists that you will encounter Z-fighting between primitives.