Beruflich Dokumente
Kultur Dokumente
D.Aju
School of Computing Science and Engineering
Several Approaches
More memory
Special objects
Classification:
Depth Cueing
Algorithms
Back-Face Detection
Depth-Buffer Method
A-Buffer Method
Scan-Line Method
Depth-Sorting Method
BSP-Tree Method
Area-SubDivision Method
Octree Method
Depth-Buffer Method
A-Buffer Method
Scan-Line Method
Area-Subdivision
Method
Object-Space Method
Back-Face Detection
BSP-Tree Method
Area-Subdivision
Method
Octree Methods
Ray-Casting Method
Back-Face Detection
(Inside-outside Test)
plane
surface
is
expressed
as
Ax +By + Cz + D < 0
Back-Face Detection
(Inside-outside Test)
N = (A, B, C)
Back-Face Detection
(Inside-outside Test)
Back-Face Detection
(0,0,1) N 0
(or)
if C 0
Back-Face Detection
Depth-Buffer Method
Depth-Buffer Method
The depth values for a pixel are compared and the closest
surface determines the color to be displayed in the frame
buffer.
Depth-Buffer Method
Frame Buffer
Depth Buffer
Depth-Buffer Method
Depth-Buffer Algorithm
Initialize the depth buffer and frame buffer so that for all buffer
positions (x,y),
depthBuff (x,y) = 1.0, frameBuff (x,y) =bgColor
The
equation
of
the
plane
surface
is
Ax +By + Cz + D = 0;
Ax By D
z
C
A( x 1) By D
z
C
Depth-Buffer Method
Partially
transparent
3rd
Opaque
2nd
Opaque
1st
OK. No Problem
1st or 2nd
3rd: Need depth
of 1st and 2nd
1st or 2nd
Problematic Ordering
A-Buffer Method
A-Buffer Method
A-Buffer Method
A-Buffer Method
A-Buffer Method
depth
surface identifier
A-Buffer Method
A-Buffer Method
The A-buffer can be constructed using methods similar to those in the
depth-buffer algorithm.
Scan lines are processed to determine surface overlaps of pixels across
the individual scan lines.
Surfaces are subdivided into a polygon mesh and clipped against the pixel
boundaries.
Using the opacity factors and percent of surface overlaps, we can calculate
the intensity of each pixel.
xv
Depth Sorting
Depth Sorting
(Painters Algorithm)
Depth Sorting
Process
The intensities for the farthest surface are then entered into the
refresh buffer.
Depth Sorting
2
3
51
3
2
3
5
1
1
4
51
26 4
3
Depth Sorting
(Overlapping Test - 1)
Yv
zv
xv
Depth Sorting
(Overlapping Test - 2)
S
S
zv
xv
Depth Sorting
(Overlapping Test - 3)
S
zv
xv
Depth Sorting
(Overlapping Test - 4)
The projections of the two surfaces onto the view plane do not
overlap.
S
S
zv
xv
Depth Sorting
Depth Sorting
(Surface Reordering)
Particularly useful
Identifying surfaces
Intersected object
Area-Subdivision Method
it is a single pixel,
or no surface at all.
Area-Subdivision Method
Require tests
Subdivide
Until belonging to a single surface
Until the size of a single pixel
Example
Surrounding surface
Overlapping surface
Surrounding Surface
Overlapping Surface
Inside surface
Outside surface
Inside Surface
Outside Surface
Octree Method
Octree - Characteristics
6
4
Front-to-back order
5
0
Displaying An Octree
0
7
1
2
Octants in Space
Comparison
Algorithm/ Methods
Memory
Speed
Issues in
Implementation
Remarks
Z-Buffer
Two Arrays
Depth
Complexity
Scan
Conversion,
Hardware
Commonly Used
Painters
One Array
Apriori Sorting
helps Sorting
Ray Casting
Object Database
0 (#pixels,
#surfaces or
objects)
Spatial data
structures help
speed up
Excellent for
CSG, Shadows,
Transparency
Hard
Cannot be
generalized for
non-polygonal
models
Scanline, AreaSubdivision