The name "painter's algorithm" refers to a simple-minded painter who paints the distant parts of a scene at first and then covers them by those parts which are nearer. Similarly, the painter's algorithm sorts all the polygons by their depth and then paints them in this order. It will over-paint the parts that are normally not visible and thus solves the visibility problem.
<center>
[[Image:Painter's_algorithm.png|600px|center|thumb|The distant mountains are painted first, followed by the closer meadows; finally, the closest objects in this scene - the trees - are painted.]]
</center>
[[Image:Painters_problem.png|right|Image:framed|Over howlapping painter'spolygons can cause the algorithm to fail]]▼
NoteThe thatalgorithm thiscan approachfail hasin severalcertain problemscases. In Whatthis happensexample, when polygonPolygons A partly covers B, B partly covers C and C partlyoverlap coverseach A again?other. It's not possible to decide which polygon is above the others.Oror when two polygons intersect one another in three dimensions? The painter's algorithm will fail in these cases.
▲[[Image:Painters_problem.png|right|Image: how painter's algorithm fail]]
In itsbasic naive implementationimplementations, painter's algorithm can prove to be highly inefficient. It forces the system to dutifully [[Computer rendering|render]] each point on every polygon in the visible set -, even if that polygon is occluded in the finished scene. This means that, for detailed scenes, the painter's algorthm generally proves to beis aan slowinnefficient solution.
These and other problemsflaws with the painter's algorithm led to the development of [[Z-buffer]] techniques, which can be viewed as a logical development of the painter's algorithm by resolving depth conflicts on a pixel-by-pixel basis, thus reducing the need for a depth-based rendering order. Even in such systems, however, a variant of painter's algorithm is sometimes employed:. asAs Z-buffer implementations generally rely on fixed-precision depth-buffer registers implemented in hardware, there is scope for visibility problems due to rounding error. - theseThese are manifest as subtle overlaps or gaps at joins between polygons. To avoid this, some graphics engine implementations "overrender" - drawing the affected edges both polygons in the order given by painter's algorithm. This means that some pixels are actually drawn twice (as in the full painters algorithm) but this proveshappens to beon only asmall tiny minorityparts of the image, and sohas hasa negligible performance effect.