SlideShare una empresa de Scribd logo
1 de 18
May 2012 1
Back-Face Detection
( )A point , , is behind a polygon surface if 0,
where , , and are the plane parameters of the polygon. Test is
simplified by considering normal of face and viewing direction.
x y z Ax By Cz D
A B C D
+ + + <
( ), ,A B C=N
viewV
( )
view
view
A polygon is back face if 0. In a right-handed
viewing system viewing direction is along negative axis,
0,0, 1 . Then, a polygon is a back face if 0.
z
C
× >
= − ≤
V N
V
May 2012 2
Depth-Buffer Methods
Three surfaces overlapping pixel position (x,y) on the view plane.
The visible surface, S1, has the smallest depth value.
vx
vy
vz
3S
2S
1S
( ),x y
view plane
May 2012 3
( )
( )
Initialize each pixel ( , ) of depth buffer and frame buffer (color):
, 1. // Z is normalized to [0,1.0]
//
0;
, background color; initialize
for ea
to backgroun
h
d
c p
x y
depthBuf x y
frameBuf x y
=
=
Z - Buffer Algorithm
( )
( ) ( )
( )
olygon {
for each pixel , polygon {
if
// traverse all polygons
// rasterization
//( , , ) {
get (compute) , ;
check closer pixel
// compute color of pixel
x y
z x y depthBuf x y
color x y
d
∈
>
( ) ( ) ( ) ( ), , ; , , ;
}}}
epthBuf x y z x y frameBuf x y color x y= =
May 2012 4
Efficient Depth Calculation
Given the depth value in a vertex of a polygon, the depth of any
other point in the plane containing the polygon can be
calculated efficiently (additions only).
( )
( ) ( )
Depth is calculated from plane equatuion .
At rasterization along scan-line changes by 1. Therefore,
1 1 , and the ratio
is constant for the entire polygon.
z Ax By D C
x
z x A x By D C z A C A C
= − − −
±
+ = − + − − = − −  
May 2012 5
A-Buffer Method
It is named so since z-buffer is used for depth semantics and in
some sense a-buffer has the nature of the other end of alphabet. It
is an extension using antialiasing, area-averaging visibility
detection method, supporting transparency.
background opaque
surface
foreground
transparent surface
08/04/15©Zachary Wartell
Scan-Line Method
• Unlike z-buffer or A-buffer, scan-line method has depth info only for
a 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 process the next scan-line
• Build table of edges of all polygons in scene. Maintain active-edge-
table as we visit each scan-line in scene. AET now contains edges
for all polygons at that scanline. Must maintain flag for each
surface to determine whether pixel on scan-line is inside that
surface.
scan-line
08/04/15©Zachary Wartell
Scan-Line Method Basic Example
• Scan Line 1:
– (A,B) to (B,C) only inside S1, so color from S1
– (E,H) to (F,G) only inside S2, so color from S2
• Scan Line 2:
– (A,D) to (E,H) only inside S1, so color from S1
– (E,H) to (B,C) inside S1 and S2 , so compute & test depth
In this example we color from S1
– (B,C) to (F,G) only inside S2, so color from S2
B
A
D
C
G
F
E
H
S1 S2
Scan Line 1
Scan Line 2
Scan Line 3
08/04/15©Zachary Wartell
Scan-Line Method Generalization
• This basic approach fails when surfaces cut-
through each other or overlap. To generalize
we must divide surfaces to eliminate overlaps
08/04/15©Zachary Wartell
Depth-Sorting Method
• Painter’s Algorithm
• Approach:
– sorted surfaces by increasing depth
• may require surface splitting
– scan-convert surfaces in sorted order (back to
front)
• Use a sequence of sorting steps and tests of
increasing computational complexity to
handle all possible cases of polygon depth
orderings
08/04/15©Zachary Wartell
• Sort surfaces by each surface’s smallest z into
list:
(S1,S2,… Si… SN)
• For all Si ,i∈[2, N]
• If farthest surface SF has no z overlap render it.
(easy case)
• If there is z overlap with SF, we can still avoid
reordering if one of four conditions holds. So
we test these conditions…
Depth Sorting Details
z
SF=S1
Si
zmin2
zmax2
zmin1
zmax1
z
SF=S1
Si
zmin2
zmax2
zmin1
zmax1
farther from
PRP !
08/04/15©Zachary Wartell
Depth Sorting: Reorder Avoidance Tests
• We can avoid reorder if:
1) Bounding rectangles in xy don’t overlap
2) Sf is completely behind overlapping surface
relative to view position
3) Overlapping surface is completely in front of
Sf relative to view position
4) Boundary edges of projections of two
surfaces on projection plane don’t overlap
z
Sf
S2
xmin1 xmax1 xmin2 xmax2
1)
Sf
S2
2) 3)
z z
Sf
S2
08/04/15©Zachary Wartell
BSP-trees
Binary Space Partition is a relatively easy way to sort the polygons relative to the eyepoint
To Build a BSP Tree
1. Choose a polygon, T, and compute the equation of the plane it defines.
2. Test all the vertices of all the other polygons to determine if they are in front of, behind, or in
the same plane as T. If the plane intersects a polygon, divide the polygon at the plane.
3. Polygons are placed into a binary search tree with T as the root.
4. Call the procedure recursively on the left and right subtree.
Larry F. Hodges, Drew Kessler
08/04/15©Zachary Wartell
Traversing BSP-Tree
• Traverse the BSP tree such that the
branch descended first is the side that is
away from the eyepoint. This can be
determined by substituting the eye point
into the plane equation for the polygon at
the root.
• When there is no first branch to descend,
or that branch has been completed then
render the polygon at this node.
• After the current node's polygon has been
rendered, descend the branch that is
closer to the eyepoint.Larry F. Hodges, Drew Kessler
08/04/15©Zachary Wartell
Area-Subdivision Method
• Recursively subdivide viewplane into quadrants until:
– rectangle contains part of 1 projected surface
– rectangle contains part of no surface
– rectangle is size of pixel
08/04/15©Zachary Wartell
Area-Subdivision Method
• We need tests that can quickly determine tell if current area is part
of one surface or if further subdivision is needed.
• Four cases for relation between surface and rectangular area:
surrounding
surface
overlapping
surface
inside
surface
outside
surface
08/04/15©Zachary Wartell
Area-Subdivision: Stopping Conditions
• Recursive subdivision can stop when either:
1) a rectangle has all surfaces outside
2) a rectangle has exactly one inside, overlapping, or
surrounding surface
3) a rectangle has one surrounding surface and the
surface occludes all other surfaces in the area
• For efficiency:
– compare rectangle to projected surface bounding
rectangle first. Only perform exact interaction
test if necessary. If single bounding rect.
intersects rectangle, test for exact intersection
and color the framebuffer for the intersection of
08/04/15©Zachary Wartell
Octrees
• Octree:
– partitions 3-space by a regular, recursive subdivision of 3-space into
axis-aligned boxes
– 3D objects are stored in the octree node that contains them.
Recursively subdivide until each octree node is either empty, a
homogeneous volume, or contains single object that’s “easy” to
compute visibility (example can use back-face culling alone).
3 2
0 1
4 5
6
7
0 1 2 3 4 5 6 7
Any of these octants could then be
recursively subdivide
08/04/15©Zachary Wartell
Ray-Casting Method
• based geometric optics method that trace rays of light
• “backwards” light path tracing
• compare to depth buffer (surfaces to pixels versus pixel to surfaces)
• special case of ray-tracing
COP
pixel
view plane

Más contenido relacionado

La actualidad más candente

Visible surface detection in computer graphic
Visible surface detection in computer graphicVisible surface detection in computer graphic
Visible surface detection in computer graphic
anku2266
 
Mid-Point Cirle Drawing Algorithm
Mid-Point Cirle Drawing AlgorithmMid-Point Cirle Drawing Algorithm
Mid-Point Cirle Drawing Algorithm
Neha Kaurav
 
Concept of basic illumination model
Concept of basic illumination modelConcept of basic illumination model
Concept of basic illumination model
Ankit Garg
 
Hidden surfaces
Hidden surfacesHidden surfaces
Hidden surfaces
Mohd Arif
 
Polygon Fill
Polygon FillPolygon Fill
Polygon Fill
wahab13
 

La actualidad más candente (20)

Graphics a buffer
Graphics a bufferGraphics a buffer
Graphics a buffer
 
Scan line method
Scan line methodScan line method
Scan line method
 
Back face detection
Back face detectionBack face detection
Back face detection
 
Visible surface detection in computer graphic
Visible surface detection in computer graphicVisible surface detection in computer graphic
Visible surface detection in computer graphic
 
Mid-Point Cirle Drawing Algorithm
Mid-Point Cirle Drawing AlgorithmMid-Point Cirle Drawing Algorithm
Mid-Point Cirle Drawing Algorithm
 
scan conversion of point , line and circle
scan conversion of point , line and circlescan conversion of point , line and circle
scan conversion of point , line and circle
 
Concept of basic illumination model
Concept of basic illumination modelConcept of basic illumination model
Concept of basic illumination model
 
3 d display methods
3 d display methods3 d display methods
3 d display methods
 
Seed filling algorithm
Seed filling algorithmSeed filling algorithm
Seed filling algorithm
 
Fill area algorithms
Fill area algorithmsFill area algorithms
Fill area algorithms
 
3D transformation in computer graphics
3D transformation in computer graphics3D transformation in computer graphics
3D transformation in computer graphics
 
Depth Buffer Method
Depth Buffer MethodDepth Buffer Method
Depth Buffer Method
 
Windowing clipping
Windowing   clippingWindowing   clipping
Windowing clipping
 
Spline representations
Spline representationsSpline representations
Spline representations
 
Hidden lines & surfaces
Hidden lines & surfacesHidden lines & surfaces
Hidden lines & surfaces
 
3 d display-methods-in-computer-graphics(For DIU)
3 d display-methods-in-computer-graphics(For DIU)3 d display-methods-in-computer-graphics(For DIU)
3 d display-methods-in-computer-graphics(For DIU)
 
Hidden surfaces
Hidden surfacesHidden surfaces
Hidden surfaces
 
Polygon Fill
Polygon FillPolygon Fill
Polygon Fill
 
2D transformation (Computer Graphics)
2D transformation (Computer Graphics)2D transformation (Computer Graphics)
2D transformation (Computer Graphics)
 
Anti aliasing Computer Graphics
Anti aliasing Computer GraphicsAnti aliasing Computer Graphics
Anti aliasing Computer Graphics
 

Destacado

Z Buffer Optimizations
Z Buffer OptimizationsZ Buffer Optimizations
Z Buffer Optimizations
pjcozzi
 
Visible surface determination
Visible  surface determinationVisible  surface determination
Visible surface determination
Patel Punit
 
Oit And Indirect Illumination Using Dx11 Linked Lists
Oit And Indirect Illumination Using Dx11 Linked ListsOit And Indirect Illumination Using Dx11 Linked Lists
Oit And Indirect Illumination Using Dx11 Linked Lists
Holger Gruen
 

Destacado (16)

Z Buffer Optimizations
Z Buffer OptimizationsZ Buffer Optimizations
Z Buffer Optimizations
 
Unity - Internals: memory and performance
Unity - Internals: memory and performanceUnity - Internals: memory and performance
Unity - Internals: memory and performance
 
How we optimized our Game - Jake & Tess' Finding Monsters Adventure
How we optimized our Game - Jake & Tess' Finding Monsters AdventureHow we optimized our Game - Jake & Tess' Finding Monsters Adventure
How we optimized our Game - Jake & Tess' Finding Monsters Adventure
 
ijca_publication
ijca_publicationijca_publication
ijca_publication
 
Mobile Performance Tuning: Poor Man's Tips And Tricks
Mobile Performance Tuning: Poor Man's Tips And TricksMobile Performance Tuning: Poor Man's Tips And Tricks
Mobile Performance Tuning: Poor Man's Tips And Tricks
 
Visible surface determination
Visible  surface determinationVisible  surface determination
Visible surface determination
 
Computer Graphics Part1
Computer Graphics Part1Computer Graphics Part1
Computer Graphics Part1
 
Oit And Indirect Illumination Using Dx11 Linked Lists
Oit And Indirect Illumination Using Dx11 Linked ListsOit And Indirect Illumination Using Dx11 Linked Lists
Oit And Indirect Illumination Using Dx11 Linked Lists
 
CG OpenGL surface detection+illumination+rendering models-course 9
CG OpenGL surface detection+illumination+rendering models-course 9CG OpenGL surface detection+illumination+rendering models-course 9
CG OpenGL surface detection+illumination+rendering models-course 9
 
GRPHICS08 - Raytracing and Radiosity
GRPHICS08 - Raytracing and RadiosityGRPHICS08 - Raytracing and Radiosity
GRPHICS08 - Raytracing and Radiosity
 
Unity Internals: Memory and Performance
Unity Internals: Memory and PerformanceUnity Internals: Memory and Performance
Unity Internals: Memory and Performance
 
Optimizing Large Scenes in Unity
Optimizing Large Scenes in UnityOptimizing Large Scenes in Unity
Optimizing Large Scenes in Unity
 
Introduction to computer graphics
Introduction to computer graphicsIntroduction to computer graphics
Introduction to computer graphics
 
Computer Graphics: Visible surface detection methods
Computer Graphics: Visible surface detection methodsComputer Graphics: Visible surface detection methods
Computer Graphics: Visible surface detection methods
 
Computer Graphics - Hidden Line Removal Algorithm
Computer Graphics - Hidden Line Removal AlgorithmComputer Graphics - Hidden Line Removal Algorithm
Computer Graphics - Hidden Line Removal Algorithm
 
Build Your Own 3D Scanner: Surface Reconstruction
Build Your Own 3D Scanner: Surface ReconstructionBuild Your Own 3D Scanner: Surface Reconstruction
Build Your Own 3D Scanner: Surface Reconstruction
 

Similar a Visual surface detection i

Computer graphics iv unit
Computer graphics iv unitComputer graphics iv unit
Computer graphics iv unit
aravindangc
 
Unit II_Graph.pptxkgjrekjgiojtoiejhgnltegjte
Unit II_Graph.pptxkgjrekjgiojtoiejhgnltegjteUnit II_Graph.pptxkgjrekjgiojtoiejhgnltegjte
Unit II_Graph.pptxkgjrekjgiojtoiejhgnltegjte
pournima055
 
ImageSegmentation (1).ppt
ImageSegmentation (1).pptImageSegmentation (1).ppt
ImageSegmentation (1).ppt
NoorUlHaq47
 

Similar a Visual surface detection i (20)

Computer graphics iv unit
Computer graphics iv unitComputer graphics iv unit
Computer graphics iv unit
 
Hidden Surface Removal using Z-buffer
Hidden Surface Removal using Z-bufferHidden Surface Removal using Z-buffer
Hidden Surface Removal using Z-buffer
 
Unit II_Graph.pptxkgjrekjgiojtoiejhgnltegjte
Unit II_Graph.pptxkgjrekjgiojtoiejhgnltegjteUnit II_Graph.pptxkgjrekjgiojtoiejhgnltegjte
Unit II_Graph.pptxkgjrekjgiojtoiejhgnltegjte
 
Clipping & Rasterization
Clipping & RasterizationClipping & Rasterization
Clipping & Rasterization
 
Surface design and visible surfaces
Surface design and visible surfacesSurface design and visible surfaces
Surface design and visible surfaces
 
testpang
testpangtestpang
testpang
 
ImageSegmentation (1).ppt
ImageSegmentation (1).pptImageSegmentation (1).ppt
ImageSegmentation (1).ppt
 
ImageSegmentation.ppt
ImageSegmentation.pptImageSegmentation.ppt
ImageSegmentation.ppt
 
ImageSegmentation.ppt
ImageSegmentation.pptImageSegmentation.ppt
ImageSegmentation.ppt
 
Image segmentation
Image segmentationImage segmentation
Image segmentation
 
UNIT-V
UNIT-VUNIT-V
UNIT-V
 
Polygon filling
Polygon fillingPolygon filling
Polygon filling
 
image segmentation image segmentation.pptx
image segmentation image segmentation.pptximage segmentation image segmentation.pptx
image segmentation image segmentation.pptx
 
Chapter 4
Chapter 4Chapter 4
Chapter 4
 
Week6.ppt
Week6.pptWeek6.ppt
Week6.ppt
 
Polar area
Polar areaPolar area
Polar area
 
LEC 12-DSALGO-GRAPHS(final12).pdf
LEC 12-DSALGO-GRAPHS(final12).pdfLEC 12-DSALGO-GRAPHS(final12).pdf
LEC 12-DSALGO-GRAPHS(final12).pdf
 
UNIT2.pptx
UNIT2.pptxUNIT2.pptx
UNIT2.pptx
 
Hidden line removal algorithm
Hidden line removal algorithmHidden line removal algorithm
Hidden line removal algorithm
 
Image segmentation
Image segmentationImage segmentation
Image segmentation
 

Último

+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
Health
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
jaanualu31
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakes
MayuraD1
 

Último (20)

AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech students
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
Computer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersComputer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to Computers
 
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 
Rums floating Omkareshwar FSPV IM_16112021.pdf
Rums floating Omkareshwar FSPV IM_16112021.pdfRums floating Omkareshwar FSPV IM_16112021.pdf
Rums floating Omkareshwar FSPV IM_16112021.pdf
 
Learn the concepts of Thermodynamics on Magic Marks
Learn the concepts of Thermodynamics on Magic MarksLearn the concepts of Thermodynamics on Magic Marks
Learn the concepts of Thermodynamics on Magic Marks
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakes
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 

Visual surface detection i

  • 1. May 2012 1 Back-Face Detection ( )A point , , is behind a polygon surface if 0, where , , and are the plane parameters of the polygon. Test is simplified by considering normal of face and viewing direction. x y z Ax By Cz D A B C D + + + < ( ), ,A B C=N viewV ( ) view view A polygon is back face if 0. In a right-handed viewing system viewing direction is along negative axis, 0,0, 1 . Then, a polygon is a back face if 0. z C × > = − ≤ V N V
  • 2. May 2012 2 Depth-Buffer Methods Three surfaces overlapping pixel position (x,y) on the view plane. The visible surface, S1, has the smallest depth value. vx vy vz 3S 2S 1S ( ),x y view plane
  • 3. May 2012 3 ( ) ( ) Initialize each pixel ( , ) of depth buffer and frame buffer (color): , 1. // Z is normalized to [0,1.0] // 0; , background color; initialize for ea to backgroun h d c p x y depthBuf x y frameBuf x y = = Z - Buffer Algorithm ( ) ( ) ( ) ( ) olygon { for each pixel , polygon { if // traverse all polygons // rasterization //( , , ) { get (compute) , ; check closer pixel // compute color of pixel x y z x y depthBuf x y color x y d ∈ > ( ) ( ) ( ) ( ), , ; , , ; }}} epthBuf x y z x y frameBuf x y color x y= =
  • 4. May 2012 4 Efficient Depth Calculation Given the depth value in a vertex of a polygon, the depth of any other point in the plane containing the polygon can be calculated efficiently (additions only). ( ) ( ) ( ) Depth is calculated from plane equatuion . At rasterization along scan-line changes by 1. Therefore, 1 1 , and the ratio is constant for the entire polygon. z Ax By D C x z x A x By D C z A C A C = − − − ± + = − + − − = − −  
  • 5. May 2012 5 A-Buffer Method It is named so since z-buffer is used for depth semantics and in some sense a-buffer has the nature of the other end of alphabet. It is an extension using antialiasing, area-averaging visibility detection method, supporting transparency. background opaque surface foreground transparent surface
  • 6. 08/04/15©Zachary Wartell Scan-Line Method • Unlike z-buffer or A-buffer, scan-line method has depth info only for a 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 process the next scan-line • Build table of edges of all polygons in scene. Maintain active-edge- table as we visit each scan-line in scene. AET now contains edges for all polygons at that scanline. Must maintain flag for each surface to determine whether pixel on scan-line is inside that surface. scan-line
  • 7. 08/04/15©Zachary Wartell Scan-Line Method Basic Example • Scan Line 1: – (A,B) to (B,C) only inside S1, so color from S1 – (E,H) to (F,G) only inside S2, so color from S2 • Scan Line 2: – (A,D) to (E,H) only inside S1, so color from S1 – (E,H) to (B,C) inside S1 and S2 , so compute & test depth In this example we color from S1 – (B,C) to (F,G) only inside S2, so color from S2 B A D C G F E H S1 S2 Scan Line 1 Scan Line 2 Scan Line 3
  • 8. 08/04/15©Zachary Wartell Scan-Line Method Generalization • This basic approach fails when surfaces cut- through each other or overlap. To generalize we must divide surfaces to eliminate overlaps
  • 9. 08/04/15©Zachary Wartell Depth-Sorting Method • Painter’s Algorithm • Approach: – sorted surfaces by increasing depth • may require surface splitting – scan-convert surfaces in sorted order (back to front) • Use a sequence of sorting steps and tests of increasing computational complexity to handle all possible cases of polygon depth orderings
  • 10. 08/04/15©Zachary Wartell • Sort surfaces by each surface’s smallest z into list: (S1,S2,… Si… SN) • For all Si ,i∈[2, N] • If farthest surface SF has no z overlap render it. (easy case) • If there is z overlap with SF, we can still avoid reordering if one of four conditions holds. So we test these conditions… Depth Sorting Details z SF=S1 Si zmin2 zmax2 zmin1 zmax1 z SF=S1 Si zmin2 zmax2 zmin1 zmax1 farther from PRP !
  • 11. 08/04/15©Zachary Wartell Depth Sorting: Reorder Avoidance Tests • We can avoid reorder if: 1) Bounding rectangles in xy don’t overlap 2) Sf is completely behind overlapping surface relative to view position 3) Overlapping surface is completely in front of Sf relative to view position 4) Boundary edges of projections of two surfaces on projection plane don’t overlap z Sf S2 xmin1 xmax1 xmin2 xmax2 1) Sf S2 2) 3) z z Sf S2
  • 12. 08/04/15©Zachary Wartell BSP-trees Binary Space Partition is a relatively easy way to sort the polygons relative to the eyepoint To Build a BSP Tree 1. Choose a polygon, T, and compute the equation of the plane it defines. 2. Test all the vertices of all the other polygons to determine if they are in front of, behind, or in the same plane as T. If the plane intersects a polygon, divide the polygon at the plane. 3. Polygons are placed into a binary search tree with T as the root. 4. Call the procedure recursively on the left and right subtree. Larry F. Hodges, Drew Kessler
  • 13. 08/04/15©Zachary Wartell Traversing BSP-Tree • Traverse the BSP tree such that the branch descended first is the side that is away from the eyepoint. This can be determined by substituting the eye point into the plane equation for the polygon at the root. • When there is no first branch to descend, or that branch has been completed then render the polygon at this node. • After the current node's polygon has been rendered, descend the branch that is closer to the eyepoint.Larry F. Hodges, Drew Kessler
  • 14. 08/04/15©Zachary Wartell Area-Subdivision Method • Recursively subdivide viewplane into quadrants until: – rectangle contains part of 1 projected surface – rectangle contains part of no surface – rectangle is size of pixel
  • 15. 08/04/15©Zachary Wartell Area-Subdivision Method • We need tests that can quickly determine tell if current area is part of one surface or if further subdivision is needed. • Four cases for relation between surface and rectangular area: surrounding surface overlapping surface inside surface outside surface
  • 16. 08/04/15©Zachary Wartell Area-Subdivision: Stopping Conditions • Recursive subdivision can stop when either: 1) a rectangle has all surfaces outside 2) a rectangle has exactly one inside, overlapping, or surrounding surface 3) a rectangle has one surrounding surface and the surface occludes all other surfaces in the area • For efficiency: – compare rectangle to projected surface bounding rectangle first. Only perform exact interaction test if necessary. If single bounding rect. intersects rectangle, test for exact intersection and color the framebuffer for the intersection of
  • 17. 08/04/15©Zachary Wartell Octrees • Octree: – partitions 3-space by a regular, recursive subdivision of 3-space into axis-aligned boxes – 3D objects are stored in the octree node that contains them. Recursively subdivide until each octree node is either empty, a homogeneous volume, or contains single object that’s “easy” to compute visibility (example can use back-face culling alone). 3 2 0 1 4 5 6 7 0 1 2 3 4 5 6 7 Any of these octants could then be recursively subdivide
  • 18. 08/04/15©Zachary Wartell Ray-Casting Method • based geometric optics method that trace rays of light • “backwards” light path tracing • compare to depth buffer (surfaces to pixels versus pixel to surfaces) • special case of ray-tracing COP pixel view plane