Professional Documents
Culture Documents
Computer Graphics - Hidden Surface Removal
Computer Graphics - Hidden Surface Removal
2001.2.28
김성남
1
Contents
• Goal
• Motivation
• Approaches
- back face detection
- depth buffer
- A-buffer
- Scan line
- Depth sorting
- BSP-tree
- Area subdivision
- Ray casting
• Conclusion 2
Goal
• A major consideration is
identifying those parts of a scene that
are visible from a chosen view position.
• Represent realistic 3D display
3
Motivation (1/4)
• Surfaces may be various of situations
according to view positions.
4
Motivation (2/4)
• Surface may be occluding
5
Motivation (3/4)
• Surfaces may be overlapping
6
Motivation (4/4)
• Surfaces may be intersecting
7
Approaches
• Back-face detection
• Depth buffer
• A-buffer
• Scan line
• Depth sorting
• BSP-tree
• Area subdivision
• Ray casting
8
Classification
• Object–space methods
- Viewer 의 가시선상에서
object 가 보이는지 , 안보이는지를 직접 결정
- wire frame display 에서 line display 시 사용
• Image-space methods
- using most methods
- projection plane 상의 각 pixel position 에
point 에 따라 visibility 결정
9
Back-face detection (1/2)
• Fast & simple object-space method
• Be based on Inside-outside test
- decide on the back face
P(x,y,z) on the polygon
Ax + By + Cz + D < 0 inside
back face
V Vz
V • N = VzC ( C : variable)
C 의 기호 (+ or -) 에 따라 N
V
back face 결정
C≤0 viewer 11
Depth-Buffer Method
(1/3)
• Image-space method
• Compare surface depths at each pixel
position on the projection plane.
• Z-buffer method
Vy
Vx
S3
S2
S1
Vz 12
Depth-Buffer Method
(2/3)
• Step
14
A-Buffer Method (1/3)
• Extension of the depth-buffer method
• Antialiased,
Area-averaged,
Accumulation-buffer method by Lucasfilm
• For implementation in the surface renderin
g system
- REYES(Renders Everything You Ever Saw)
• Viewing for more than one surface
• Antialiasing
15
A-Buffer Method (2/3)
• A-Buffer has two fields
- depth field : store +,- real number
- intensity field
• Using Linked list
d>0 I • Surf Surf •
d<0 •
1 2
Depth Intensity Depth Intensity
field field field field
21
Depth Sorting Method (3/7)
• Overlap test
1.Bounding rectangles in the xy plane for
the two surfaces do not overlap.
2.Surface S is completely behind the overlap
-ping surface relative to the view position
3.Overlapping surface is completely in front
of S relative to the view position
4.The projections of the two surfaces onto
the view plane do not overlap
one of these test is true no reordering
22
Depth Sorting Method (4/7)
1. bounding rectangles in the xy plane for
the two surfaces do not overlap
S
S’
Vx
Xmin Xmax X’min X’max
Vz
23
Depth Sorting Method (5/7)
2.Surface S is completely behind the overlap
-ping surface relative to the view position
3.Overlapping surface is completely in front
of S relative to the view position
S S
S’ S’
Vx Vx
25
Depth Sorting Method (7/7)
• When 4 tests failed,
interchange surfaces in the sorted list
S S
S’
S’ S’’
Vx Vx
27
BSP-Tree Method (2/2)
P2
back P1
C front P
front 1
P2 P2
A D
front back
front back
A C B D
B
Painting order
D→B→C→A
28
Area-Subdivision Method (1/4)
• Image-space method
- object-space method : depth ordering
• Start with total view →
determine whether subdivision or not →
subdivision → until a single surface or
the size of a single pixel
• Similar to quad tree
29
Area-Subdivision Method (2/4)
surface
Boundary area
Zmax
(surrounding
surface)
Vx
Vz
32
Area
Ray Casting Method (1/2)
• Cast ray from viewpoint through each pixel
to find front-most surface
33
Ray Casting Method (2/2)
• Light-ray paths backward from the pixels
through the scene
• More effective detection method
- Curved surface, particularly spheres
• a variation on the depth buffer method
• Conceptually simple, but not generally used
34
Summary
• Hidden Surface Removal Algorithm
- Back-face detection
- Depth buffer
- A-buffer
- Scan line
- Depth sorting
- BSP-tree
- Area subdivision
- Ray casting
35