Painter's algorithm: Difference between revisions

Content deleted Content added
tweaks
two special cases
Line 3:
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, when you want to use this algorithm in your rendering system, you first sort all the polygons by their depth and then paint them in this order. You will over-paint the parts that are normally not visible and thus solve the visibility problem.
 
Note that this approach has several problems. What happens, when polygon A partly covers B, B partly covers C and C partly covers A again? Or when two polygons intersect one another in three dimensions? The painter's algorithm will fail in thisthese casecases. Another problem is that it is very slow because the computer needs to [[render]] the intensities at all points of all polygons even if they will not be seen in the final scene because the polygon is not visible.