Hidden%20Surface%20Removal - PowerPoint PPT Presentation

About This Presentation
Title:

Hidden%20Surface%20Removal

Description:

Back-face culling (removal) Depth sorting and Painter's algorithm. Image-space algorithm: ... Back-Face Culling. For convex objects, we can't see the back faces. ... – PowerPoint PPT presentation

Number of Views:366
Avg rating:3.0/5.0
Slides: 17
Provided by: csNth
Category:

less

Transcript and Presenter's Notes

Title: Hidden%20Surface%20Removal


1
Hidden Surface Removal
  • April 30, 2007

2
Hidden Surface Removal
  • Object-space algorithms
  • Back-face culling (removal)
  • Depth sorting and Painters algorithm
  • Image-space algorithm
  • Z Buffer!
  • Fast, but requires more memory.

3
Back-Face Culling
  • For convex objects, we cant see the back faces.
  • But, how do we determine the back faces?

4
(No Transcript)
5
(No Transcript)
6
(No Transcript)
7
Painters Algorithm
  • Draw from back to front.
  • No solution for
  • Cyclic ordering
  • Intersecting surfaces

8
Z Buffer
  • At each pixel, store the Z of the front-most
    surface.
  • If the new Z is larger, its occluded.
  • If the new Z is smaller, then
  • Draw the new surface
  • Update the Z

9
Other Algorithms
  • Scan-line algorithm See Section 7.11 of Ed
    Angels book (4th Ed).
  • For more advanced research in this area, see
  • Chen and Wang, SIGGRAPH 1996.
  • Snyder and Lengyel, SIGGRAPH 1998.

10
  • from the previous lecture

11
Projection Matrix
12
Range of Z
  • If Z near, what is Z?
  • -1
  • If Z far, what is Z?
  • 1
  • Does Z change linearly with Z?
  • No!
  • Z wZ / w (aZb) / Z a b/Z

13
Z Resolution
  • Since screen Z is expressed in the form of
    ab/Z, most of the Z resolution is used up by the
    Zs closer to the near plane.
  • So, what does this mean?
  • You shouldnt set zNear to be very close to the
    eye position.

14
Near10 Far1000
Near100 Far1000
Notice the change in the range of Z after
transformation (in NDC space) for the original Z
(in eye space) between 200 and 400 (marked by the
Red boxes).
15
Why Not Linear?
  • To make it linear, we will have to make WZ
    aZ2 bZ (so that Z WZ/W aZ b)
  • But thats impossible with the perspective matrix

16
Linear Z Buffer or W Buffer
  • Wait! Why is linear Z impossible under
    perspective projection? Cant we simply ignore
    the divide-by-w step for Z?
  • Yes, but we no longer have the nice math of the
    homogeneous coordinates

Division by w
Write a Comment
User Comments (0)
About PowerShow.com