Painter's algorithm: Difference between revisions

Content deleted Content added
mNo edit summary
Hhanke (talk | contribs)
image included
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.
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 these cases. 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.
What happens when polygon A partly covers B, B partly covers C and C partly covers A again? It's not possible to decide which polygon is above the others. Or when two polygons intersect one another in three dimensions? The painter's algorithm will fail in these cases.
 
[[Image:Painters_problem.png|Image: how painter's algorithm fail]]
 
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 these cases. 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.