Visible Surface
Visible Surface
Classification of Visible-Surface
Detection Algorithms
Object-space methods vs. Image-space methods
• Object definition directly vs. their projected images
• Most visible-surface algorithms use image-space methods
• Object-space can be used effectively in some cases
Ex) Line-display algorithms
Object-space methods
• Compares objects and parts of objects to each other
Image-space methods
• Point by point at each pixel position on the projection plane
2
Back-Face Detection
Inside-outside test
V N 0 N = (A, B, C)
V
(x, y)
Xv
7 Zv
Depth Buffer & Refresh Buffer
• Refresh buffer
Stores the intensity values for each position
All positions are initialized to the background intensity
8
Algorithm
Initialize the depth buffer and refresh buffer
depth(x, y) = 0, refresh(x, y) = Ibackgnd
For each position on each polygon surface
• Calculate the depth for each (x, y) position on the polygon
• If z > depth(x, y), then set
depth(x, y) = z, refresh(x, y) = Isurf(x, y)
Advanced
• With resolution of 1024 by 1024
Over a million positions in the depth buffer
• Process one section of the scene at a time
Need a smaller depth buffer
The buffer is reused for the next section
9
A-Buffer Method
Characteristics
12
Algorithm(2 / 2)
13
Scan-Line Method
Characteristics
15
Tables for The Various Surfaces
Edge table
• Coordinate endpoints for each line
• Slope of each line
• Pointers into the polygon table
Identify the surfaces bounded by each line
Polygon table
• Coefficients of the plane equation for each surface
• Intensity information for the surfaces
• Pointers into the edge table
16
Active List & Flag
Active list
• Contain only edges across the current scan line
• Sorted in order of increasing x
Flag for each surface
• Indicate whether inside or outside of the surface
• At the leftmost boundary of a surface
The surface flag is turned on
• At the rightmost boundary of a surface
The surface flag is turned off
17
Example
D
the flag for surface S1 is on G
xv
No depth calculations are necessary
Intensity for surface S1 is entered into the refresh buffer
18
Example(cont.)
19
Drawback
20
Image-Space Method vs.
Object-Space Method
Image-Space Method Object-Space Method
• Depth-Buffer Method • Back-Face Detection
• A-Buffer Method • BSP-Tree Method
• Scan-Line Method • Area-Subdivision Method
• Area-Subdivision Method • Octree Methods
• Ray-Casting Method
21
Comparison(1 / 2)
A-buffer method
• An improvement on the depth-buffer approach
• Additional information
Antialiased and transparent surfaces
Other visible-surface detection schemes
• Scan-line method
• Depth-sorting method(painter’s algorithm)
• BSP-tree method
• Area subdivision method
• Octree methods
• Ray casting
23