0% found this document useful (0 votes)
87 views15 pages

CGA Sem 4

The document discusses various techniques for determining visible surfaces in 3D computer graphics, including both object-space and image-space methods. It describes key object-space techniques like back face removal that cull invisible polygons. For image-space methods it covers the fundamental z-buffer algorithm, which uses depth testing to determine visibility on a per-pixel basis, and also describes scan-line and other algorithms.

Uploaded by

Sam Sepiol
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)
87 views15 pages

CGA Sem 4

The document discusses various techniques for determining visible surfaces in 3D computer graphics, including both object-space and image-space methods. It describes key object-space techniques like back face removal that cull invisible polygons. For image-space methods it covers the fundamental z-buffer algorithm, which uses depth testing to determine visibility on a per-pixel basis, and also describes scan-line and other algorithms.

Uploaded by

Sam Sepiol
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/ 15

Visible-Surface Determination

 Given a set of 3D objects and a viewing specification, determine which


lines or surfaces should be visible
 Visible-Surface Determination mainly focuses on following:-
1. Visibility Culling
2. Hidden-Surface Elimination
3. Shadows
Techniques for Efficient Visible Surface
Algorithms
Object Space Method
• Object space method do their work on the objects themselves before they are
converted to pixels in the frame buffer.
• The resolution of the display device is irrelevant here as this calculation is done
at the mathematical level of the objects
Image Space Method
• Image space method do their work as the objects are being converted to pixels in
the frame buffer.
• The resolution of the display device is important here as this is done on a pixel
by pixel basis.
Object Space v/s Image Space

Object Space Image Space


• It considers each object only once. • It considers each pixel only once.
• It draws pixels of an object and • It draws part of an object and
move on to the next object. move on to the next pixel.
• It might draw the same pixel • It might compute the relationships
multiple times. between objects multiple times.
Different Categories of Visible-Surface Detection Algorithm
1. Back Face Removal Algorithm
 It removes those parts of an object which are not visible known as back faces
and displays only visible part of an object known as front faces.
 It uses object space technique to remove the back faces of an object.

2. Z-Buffer or Depth Buffer Algorithm


 Z-Buffer or Depth Buffer Method is commonly used image space method for
detecting visible surface.
 It compares surface depths at each pixel position on a projection plane.
 It is called Z-Buffer method as object depth is usually measured from view
plane along the z-axis of the viewing system.
3. A-Buffer Algorithm
 It is a part of Image space algorithm. A-Buffer expands on the depth buffer
method to allow transparencies.
 The key data structure in the A-Buffer is the accumulation buffer.

4. Scan Line Algorithm


 It is an Image-space method to identify visible surface. This method has a depth
information for only single scan-line.

5. Binary Space Partitioning(BSP) Tree Algorithm


 Binary Space Partitioning is used to calculate visibility.
6. Depth sort or Painter’s Algorithm
 Depth sorting method uses both image space and object-space operations.
 The name painter's algorithm refers to the technique employed by many painters
for painting distant parts of a scene before painting parts which are nearer
thereby covering some areas of distant parts.
 The painter's algorithm sorts all the polygons in a scene by their depth and then
paints them in this order, farthest to closest.
 It will paint over the parts that are not visible which solves the visibility
problem.

7. Area Subdivision Algorithm


 Area subdivision method divides the total viewing area into smaller and smaller
rectangles until each small area is the projection of part of a single visible
surface or no surface at all.
Back Face Removal
If ‘V’ is a vector in the viewing
direction of eye or “camera” position,
then this polygon is back face

V.N > 0

Furthermore, if object descriptions are


converted to projection coordinates
and your viewing direction is parallel
to the viewing z-axis

V = (0, 0, Vz)  and V.N = VZC


Back faces have normal vectors that point away from the viewing position and are identified by
C≥0 when the viewing direction is along the positive Zv axis.
By examining parameter C for the different planes defining an object, we can immediately
identify all the back faces.

 If C < 0 : Back Face of the polygon


 If C = 0 : Gazing the polygon, not visible from viewing position
 If C > 0 : Face visible from viewing position
The Z-Buffer Algorithm
In this method each surface is processed separately one pixel position at a time across the surface.
The depth values for a pixel are compared and the closest (minimum z) surface determines the
color to be displayed in the frame buffer.
It is applied very efficiently on surfaces of polygon. Surfaces can be processed in any order. To
override the closer polygons from the far ones, two buffers named frame buffer and depth
buffer, are used.

Depth Buffer is used to store


depth value “x,y” position.

Frame Buffer is used to store


intensity value of color value at
each position “x,y” .
Algorithm
Step-1: Set the buffer values:
zbuffer (x,y) = 0
Framebuffer (x,y) = background color
Step-2: Process each polygon (One at a time) for each
projected (x,y) pixel position of a polygon, calculate depth z.
If z > buffer (x,y) then
set zbuffer (x,y) = z,
Compute surface color as,
framebuffer (x,y) = surfacecolor (x,y)
After all surfaces are processed zbuffer and framebuffer will
store correct values.
Advantages Disadvantages
• It is easy to implement. • It requires large memory.
• It reduces the speed problem if • It is time consuming process
implemented in hardware.
• It processes one object at a time.
Scan-Line Method
 It is an Image-space method to identify visible surface.
 This method has a depth information for only single scan-line.
 In order to require one scan-line of depth values, we must group and process all polygons
intersecting a given scan-line at the same time before processing the next scan-line.
 Two important tables, edge table and polygon table, are maintained for this.

The Edge Table − It contains coordinate endpoints of each line in the scene, the inverse
slope of each line, and pointers into the polygon table to connect edges to surfaces.

The Polygon Table − It contains the plane coefficients, surface material properties, other
surface data, and may be pointers to the edge table.
EDGE TABLE

POLYGON TABLE

You might also like