0% found this document useful (0 votes)
134 views21 pages

Visible Surface Detection All

This document discusses various methods for detecting visible surfaces in 3D computer graphics, including object-space and image-space approaches. It provides details on back-face detection, depth-buffer, BSP-tree, and area-subdivision methods. The depth-buffer method compares surface depth values at each pixel and the BSP-tree method identifies surfaces behind partitioning planes to determine visibility. The area-subdivision method successively divides the view plane into smaller areas belonging to single surfaces.

Uploaded by

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

Visible Surface Detection All

This document discusses various methods for detecting visible surfaces in 3D computer graphics, including object-space and image-space approaches. It provides details on back-face detection, depth-buffer, BSP-tree, and area-subdivision methods. The depth-buffer method compares surface depth values at each pixel and the BSP-tree method identifies surfaces behind partitioning planes to determine visibility. The area-subdivision method successively divides the view plane into smaller areas belonging to single surfaces.

Uploaded by

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

Visible surface

Detection
Method

Mr. Dhiraj Rane


Outline

 Classification of Visible-Surface Detection Algorithms


 Back-Face Detection
 Depth-Buffer Method
 A-Buffer Method
 Scan-Line Method
 Depth-Sorting Method
 BSP-Tree Method
 Area-Subdivision Method
 Octree Methods
 Ray-Casting Method
 Comparison of Visibility-Detection Methods
 Wire-Frame Visibility Methods
 OpenGL Visibility-Detection Functions

2
Mr. Dhiraj Rane Computer Graphics
3
Classification of Visible- Surface Detection Algorithms

 2 approaches
 Object-Space Method
 Compares objects and parts of objects to each other
within the scene
 Determine surface as a whole
 Image-Space Method
 Visibility is decided point by point at each pixel position on
the projection plane
 Most visibility-surface algorithms use image-space
methods

Mr. Dhiraj Rane Computer Graphics


4
Back-Face Detection
 A fast and simple object-space method
 Find the faces on the backs of polyhedral and discard them
 A point is behind a polygon surface if
– Ax + By + Cz + D < 0

Vview
.N>0
 Back-face test by considering the direction of the normal vector for a
polygon surface
 A polygon is a back face if

Mr. Dhiraj Rane Computer Graphics


5
Back-Face Detection (2)

 Right-handed viewing system


 If object is converted to projection coordinates
and viewing direction is parallel to zv axis,
 Only consider the z component of the normal vector N
 N = (A, B, C)
 A polygon is back face if C<=0

 Similarly, left-handed system, back face if C >= 0

Mr. Dhiraj Rane Computer Graphics


6
Ex. Back-Face Detection

y yview xview
zvie
N(3,2,6)
B(0,3,0)
3x+2y+6z -6=0

C(0,0,1) A(2,0,0)
z x

Mr. Dhiraj Rane Computer Graphics


7
Back-Face Detection (3)

 Complete visibility test for nonoverlapping


convex polyhedra

 For concave polygon, more test must be


carried out to determine whether there
are additional faces that are totally or
partially obscured by other faces

 For a general scene, back-face removal


can be expected to eliminate about half of
the polygon surfaces in a scene from
further visibility tests

Mr. Dhiraj Rane Computer Graphics


8
Depth-Buffer Method

 Image-space approach
 Compares surface depth
values throughout a
scene from each pixel
position on the projection
plane
 Also called the z-buffer
method
 Depth is measured along
the z-axis

Mr. Dhiraj Rane Computer Graphics


9
Depth-Buffer Method (2)

 2 buffer areas are required


 A depth buffer
 Stores depth values for each (x, y) position
 Frame buffer (Refresh buffer)
 Stores the surface-color values for each pixel position
 Calculated depth is compared with the stored value, if it is less
than value in the depth buffer, the new value is stored
 Algorithm
1. Initialize the depth and frame buffer
 depthBuff(x, y) = 1.0, frameBuff(x, y) = backgndColor
2. Process each polygon in a scene
 For each projected (x, y) pixel, calculate the depth z
 If z < depthBuff(x, y), compute the surface color
 depthBuff(x, y) = z, frameBuff(x, y) = surfColor(x, y)

Mr. Dhiraj Rane Computer Graphics


10
Depth-Buffer Method (3)

 Calculate the depth of any point on the plane containing the polygon
 A surface position (x, y) from plane equation
z = (-Ax-By-D)/C
 Depth z’ of (x+1, y)
z’ = [-A(x+1)-By-D]/C, z’ = z-A/C
 Depth z’ of (x-1/m, y-1)
z’ = [-A(x-1/m)-B(y-1)-D]/C, z’ = z+(A/m+B)/C
 Depth z’ of (x, y-1)
z’ = [-Ax-B(y-1)-D]/C, z’ = z+B/C

Mr. Dhiraj Rane Computer Graphics


11
BSP-Tree Method

 Painting surfaces into frame buffer from back


to front – painter’s algorithm
 Useful when the view reference point
changes, but the objects in a scene are at
fixed positions
 Visibility testing involves identifying surfaces
behind or in front of the partitioning plane
at each step of the space subdivision

Mr. Dhiraj Rane Computer Graphics


12
BSP-Tree Method

 When BSP tree is complete, process the tree from


the right nodes to the left nodes

Mr. Dhiraj Rane Computer Graphics


13
BSP-Tree Method

5 3
5a
2
5b
3 4
1
1
2 5b
4
5a

Mr. Dhiraj Rane Computer Graphics


14
BSP-Tree Method

5 3
5a front back
2
5b
3 2 4
1 front back
5b
4
5a 1

Mr. Dhiraj Rane Computer Graphics


15
BSP-Tree Method

5 3
5a front back
2
5b
3 2 4
1 front back back

4
5a 1 5b

Mr. Dhiraj Rane Computer Graphics


Area-Subdivision Method

Image-space method
 Take advantage of coherence, by locating projection

areas that represent part of a single surface


 By successively dividing the total view- plane area

into smaller and smaller rectangular


 An easy way is to successively divide the area into 4 equal
parts at each step
 Each rectangular contains the projection of part of a
single visible surface

Mr. Dhiraj Rane Computer Graphics


Area-Subdivision Method (2)
 First, test if the view is sufficiently
complex
 Yes, subdivide it
 Test to each smaller areas, subdividing if a
single surface is still uncertain
 Continue until subdivisions are easily
analysed as belonging to a single surface
or reached the resolution limit

Mr. Dhiraj Rane Computer Graphics


Area-Subdivision Method (3)

 Relationship between a surface and an area of the subdivided view


plane
 Surrounding surface
 Completely encloses the area
 Overlapping surface
 Partly inside and partly outside the area
 Inside surface
 Completely inside the area
 Outside surface
 Completely outside the area

Mr. Dhiraj Rane Computer Graphics


Area-Subdivision Method (4)
 Test for determining surface visibility within a
rectangular area
 No further subdivisions if one of the following
conditions is true
 Condition 1: All surfaces are outside the area
 Condition 2: An area has only one inside,
overlapping, or surrounding
 Condition 3: An area has one surrounding surface
that obscures all other surfaces

Mr. Dhiraj Rane Computer Graphics


Area-Subdivision Method (5)
 Condition 1 test by comparing coordinate extents of
each surface
 Condition 2 usually require intersection tests
 Condition 3
 test by sorting surfaces according to minimum depth from view
plane
 Use plane equation to calculate depth values at four vertices of
the area for all surrounding, inside, overlapping surfaces
 Once a surface has been identified as an outside or
surrounding, it will remain in that category for all
subdivisions of the area

Mr. Dhiraj Rane Computer Graphics


Area-Subdivision Method (6)
 As a variation
 Subdivision along surface boundaries instead of
dividing them in half
 In general, fewer subdivisions are required, but
more processing is needed to subdivide and to
analyse the relation of surfaces

Mr. Dhiraj Rane Computer Graphics

You might also like