Upload
aubrey-durham
View
20
Download
0
Embed Size (px)
DESCRIPTION
HSR & Z-Buffer. HSR (Hidden Surface Removal). Painters algorithm Depth-sorting; Back-to-front rendering Sort based on some points on the polygon. Painter’s algorithm (cont). Cannot resolve this: No correct ordering to draw these polygons. HSR (cont). Z-buffer Algorithm - PowerPoint PPT Presentation
Citation preview
HSR & Z-Buffer
Fall 2009 revised 2
HSR (Hidden Surface Removal)
• Painters algorithm– Depth-sorting; Back-to-front rendering– Sort based on some points on the polygon
Painter’s algorithm (cont)
• Cannot resolve this:– No correct ordering to draw these polygons
Fall 2009 revised 4
HSR (cont)• Z-buffer Algorithm
– For each pixel, we keep track of the corresponding depth or distance.– This is called the z-buffer.– If a new object is drawn, only replace the pixels in the frame-buffer if
the new pixel’s value is less than the pixel’s value in the z-buffer.
Fall 2009 revised 5
Z-BufferNote: OpenGL has 0 at the near end and 1 at the far end
near
far