Depth Buffering

Rendering a polygon means filling pixels

Color buffer contains RGB color of each pixel drawn

Depth buffer contains depth of each pixel drawn

ColorDepth










When drawing a new pixel, compare new depth to what's stored in depth buffer

ColorDepth



Polygons can be drawn in any order
Polygons can intersect





next