0% found this document useful (0 votes)
171 views

Visible Surface

The document discusses and compares different algorithms for visible surface detection in 3D computer graphics. It describes object-space methods like back-face detection that eliminate hidden surfaces directly using surface normals, and image-space methods like depth buffering and scanline rendering that determine visibility on a per-pixel basis. The depth buffer approach is commonly used due to its speed and simplicity, while the A-buffer method improves on it by allowing accumulation of intensities from multiple surfaces at each pixel position.

Uploaded by

Prachi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
171 views

Visible Surface

The document discusses and compares different algorithms for visible surface detection in 3D computer graphics. It describes object-space methods like back-face detection that eliminate hidden surfaces directly using surface normals, and image-space methods like depth buffering and scanline rendering that determine visibility on a per-pixel basis. The depth buffer approach is commonly used due to its speed and simplicity, while the A-buffer method improves on it by allowing accumulation of intensities from multiple surfaces at each pixel position.

Uploaded by

Prachi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 23

Introduction

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

 A point (x, y, z) is “inside” a surface with plane


parameters A, B, C, and D if
Ax  By  Cz  D  0
 The polygon is a back face if

V N 0 N = (A, B, C)
V

• V is a vector in the viewing direction from the eye(camera)


• N is the normal vector to a polygon surface
4
Advanced Configuration

 In the case of concave polyhedron


• Need more tests
 Determine faces totally or partly obscured by other faces
• In general, back-face removal can be expected to eliminate
about half of the surfaces from further visibility tests

<View of a concave polyhedron with


one face partially hidden by other surfaces>
5
Depth-Buffer Method
Characteristics

 Commonly used image-space approach


 Compares depths of each pixel on the projection
plane
• Referred to as the z-buffer method
 Usually applied to scenes of polygonal surfaces
• Depth values can be computed very quickly
Yv
• Easy to implement S3 S2
S1

(x, y)
Xv

7 Zv
Depth Buffer & Refresh Buffer

 Two buffer areas are required


• Depth buffer
 Store depth values for each (x, y) position
 All positions are initialized to minimum depth
 Usually 0 – most distant depth from the viewplane

• 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

 An extension of the ideas in the depth-buffer method


 The origin of this name
• At the other end of the alphabet from “z-buffer”
• Antialiased, area-averaged, accumulation-buffer
• Surface-rendering system developed by ‘Lucasfilm’
 REYES(Renders Everything You Ever Saw)
Foreground
 A drawback of the depth-buffer method transparent surface

• Deals only with opaque surfaces


• Can’t accumulate intensity values
for more than one surface
Background
opaque surface
11
Algorithm(1 / 2)
 Each position in the buffer can reference a linked list
of surfaces
• Several intensities can be considered at each pixel position
• Object edges can be antialiased
 Each position in the A-buffer has two fields
• Depth field
 Stores a positive or negative real number
• Intensity field
 Stores surface-intensity information or a pointer value
d>0 I d<0 Surf1 Surf2 
Depth Intensity Depth Intensity
field (a) field field (b) field
<Organization of an A-buffer pixel position : (a) single-surface overlap (b) multiple-surface overlap>

12
Algorithm(2 / 2)

 If the depth field is positive


• The number at that position is the depth
• The intensity field stores the RGB
 If the depth field is negative
• Multiple-surface contributions to the pixel
• The intensity field stores a pointer to a linked list of
surfaces
• Data for each surface in the linked list
 RGB intensity components  Percent of area coverage
 Opacity parameters(percent of transparency)  Surface identifier
 Depth  Pointers to next surface

13
Scan-Line Method
Characteristics

 Extension of the scan-line algorithm for filling


polygon interiors
• For all polygons intersecting each scan line
 Processed from left to right
 Depth calculations for each overlapping surface
 The intensity of the nearest position is entered into the
refresh buffer

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

 Active list for scan line 1 B


E
yv F
• Edge table A
Scan line 1
S1 S2
Scan line 2
 AB, BC, EH, and FG
H Scan line 3
 Between AB and BC, only C

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

 Similarly, between EH and FG, only the flag for S2 is on

18
Example(cont.)

 For scan line 2, 3


• AD, EH, BC, and FG
 Between AD and EH, only the flag for S1 is on
 Between EH and BC, the flags for both surfaces are on
 Depth calculation is needed
 Intensities for S1 are loaded into the refresh buffer until
BC
• Take advantage of coherence
 Pass from one scan line to next
 Scan line 3 has the same active list as scan line 2
 Unnecessary to make depth calculations between EH
and BC

19
Drawback

 Only if surfaces don’t cut through or


otherwise cyclically overlap each other
• If any kind of cyclic overlap is present
 Divide the surfaces

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)

 Back-face detection methods


• Fast and effective as an initial screening
 Eliminate many polygons from further visibility tests
• In general, this can’t completely identify all
hidden surfaces
 Depth-buffer(z-buffer) method
• Fast and simple
• Two buffers
 Refresh buffer for the pixel intensities
 Depth buffer for the depth of the visible surface
22
Comparison(2 / 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

You might also like