With our simplified pipeline, the application sends down triangles to be transformed to, to screen locations and then filled in. What happens if two triangles overlap on the screen? How is it decided which one is visible? One way to render it is what is called the painter’s algorithm. The idea is to draw each object one on top of the other. To make this work, you sort objects based on their distance from the camera back to front. You then render the most distant object first. Render the next closest object. Render the next closest object than that and so on. The closest object is drawn last so it covers up the objects behind it. This isn’t really how most painters actually paint but it could work in theory for, say, oil paints. I guess it makes some sense for computers to use it since it’s a somewhat mindless way to paint a painting.