depth buffering, one sees the horse’s mane and tail even though they should be
occluded by the horse’s body! The order
triangles are rendered matters.
one could implement the painter’s algorithm, which
draws the primitives from far to near.
Implementing this requires depth-sorting the primitives, which is
usually inconvenient and less suited to GPU hardware.
the depth buffer:glClearDepth(1.0f);
one of the polygons (order does not matter):
the other polygon:
Advantage: order-independent rendering
Disadvantage: may write the same pixel multiple times