Painter’s algorithm is used in 3D graphics rendering to ensure that elements closer to the viewer are rendered in the top layer.
Conceptually Painter’s Algorithm works as follows:
- Sort each polygon by depth
- Place each polygon from the farthest polygon to the closest polygon