| 9.Vis1 |
![[prev]](common/prev.gif)
Back-face Culling
|
Back-face Culling
Polygon is back-facing if: V.N > 0
|
Back-face Culling
Polygon is back-facing if: V.N > 0
Assuming view is along Z (v = (0, 0, 1)) V.N = (0 + 0 + zn) |
Back-face Culling
Polygon is back-facing if: V.N > 0
Assuming view is along Z (v = (0, 0, 1)) V.N = (0 + 0 + Zn) Simplify further to if Zn > 0, then cull Works for non-overlapping convex polyhedra |
Back-face Culling
Polygon is back-facing if: V.N > 0
Assuming view is along Z (v = (0, 0, 1)) V.N = (0 + 0 + Zn) Simplify further to if Zn > 0, then cull Works for non-overlapping convex polyhedra with concave polyhedra, some hidden surfaces
will not be culled
|
Painter's AlgorithmFirst polygon:
(6, 3, 10), (11, 5, 10), (2, 2, 10)
scan it in
|
Painter's AlgorithmSecond polygon:
(1, 2, 8), (12, 2, 8), (12, 6, 8), (1, 6, 8)
scan it on top
|
Painter's AlgorithmThird polygon:
(6, 5, 5), (14, 5, 5), (14, 10, 5), (6, 10, 5)
scan it on top
|
Painter's Algorithm
Given
List of Polygons { P1, P1, ... , P1 }
An array Intensity [x, y]
Begin
Sort polygon list on minimum Z
(largest Z-value comes first in sorted list)
for each polygon P in selected list do
for each pixel (x, y) that intersects P do
Intensity [x, y] = intensity of P at (x, y)
Display Intensity array
|
Painter's Algorithm: Cyclic Overlapping
Which order to scan? |
Painter's Algorithm: Cyclic Overlapping
Split along line, then scan 1, 2, 3 |
Painter's Algorithm: Cyclic Overlapping
Which order to scan? |
Painter's Algorithm: Cyclic Overlapping
Split along line, then scan 1, 2, 3, 4 (or split another polygon and scan accordingly) Moral:
|
Depth-sort: Overlapping Surfaces
Assume you have sorted by maximum Z |
Depth-sort: Overlapping Surfaces
Assume you've selected by maximum Z Correct ordering of overlapping surfaces may be ambiguous.
|
Depth-sort: Overlapping Surfaces
Assume you've selected by maximum Z Correct ordering of overlapping surfaces may be ambiguous.
|
Depth-sort: Overlapping Surfaces
Assume you've selected by maximum Z Correct ordering of overlapping surfaces may be ambiguous.
|
Depth-sort: Overlapping Surfaces
Assume you've selected by maximum Z Correct ordering of overlapping surfaces may be ambiguous.
|
Depth-sort: Checking Order Ambiguity(1) Bounding rectangles in xy plane do not overlap
|
Depth-sort: Checking Order Ambiguity(1) Bounding recrangles in xy plane do not overlap
|
Depth-sort: Checking Order Ambiguity(2) Surface S is completely behind S' relative to viewing direction.
|
Depth-sort: Checking Order Ambiguity(2) Surface S is completely behind S' relative to viewing direction.
|
Depth-sort: Checking Order Ambiguity(3) S' completely in front of S relative to viewing direction
|
Depth-sort: Checking Order Ambiguity(3) S' completely in front of S relative to viewing direction
|
Depth-sort: Checking Order Ambiguity(4) Projection of the two surfaces onto the viewing plane do not overlap
|
Depth-sort: Checking Order Ambiguity(4) Projection of the two surfaces onto the viewing plane do not overlap
|
Depth-sort: Checking Order Ambiguity(4) Projection of the two surfaces onto the viewing plane do not overlap
|
Depth-sort: Checking Order Ambiguity(4) Projection of the two surfaces onto the viewing plane do not overlap
|
Z-BufferFirst polygon:
(1, 1, 5), (7, 7, 5), (1, 7, 5)
scan it in with depth
|
Z-BufferSecond polygon:
(3, 5, 9), (10, 5, 9), (10, 9, 9), (3, 9, 9)
|
Z-BufferThird polygon:
(2, 6, 3), (2, 3, 8), (7, 3, 3)
|
Z-Buffer
|
Z-Buffer Algorithm
Given
List of Polygons { P1, P1, ... , P1 }
An array z-buffer [x, y] initialized to +infinity
An array Intensity [x, y]
Begin
for each polygon P in selected list do
for each pixel (x, y) that intersects P do
Calculate z-depth of P at (x, y)
if z-depth < z-buffer [x, y] then
Intensity [x, y] = intensity of P at (x, y)
z-buffer [x, y] = z-depth
Display Intensity array
|
Z-Buffer: Calculating Z-Depthfrom plane equation, depth at position (x, y):
|
Z-Buffer: Calculating Z-Depthfrom plane equation, depth at position (x, y):
Incrementally across scan line (x+1, y):
|
Z-Buffer: Calculating Z-Depthfrom plane equation, depth at position (x, y):
Incrementally across scan line (x+1, y):
|
Z-Buffer: Calculating Z-Depthfrom plane equation, depth at position (x, y):
Incrementally across scan line (x+1, y):
|
Z-Buffer: Calculating Z-Depthfrom plane equation, depth at position (x, y):
Incrementally across scan line (x+1, y):
Incrementally between scan lines (x', y+1):
|
Z-Buffer: Calculating Z-Depthfrom plane equation, depth at position (x, y):
Incrementally across scan line (x+1, y):
Incrementally between scan lines (x', y+1):
|
Z-Buffer: Calculating Z-Depthfrom plane equation, depth at position (x, y):
Incrementally across scan line (x+1, y):
Incrementally between scan lines (x', y+1):
|
Z-Buffer: CharacteristicsGood:
|
Z-Buffer: CharacteristicsGood:
Bad
|
A-Buffer methodBasically z-buffer with additional memory to consider contribution of multiple surfaces to a pixel
|
A-Buffer methodBasically z-buffer with additional memory to consider contribution of multiple surfaces to a pixel
Need to store:
|
Taxonomy of Visibility Algorithms
|
Taxonomy of Visibility Algorithms
|
Taxonomy of Visibility Algorithms
|
![[prev]](common/prev.gif)
| Made by dynaPage 0.2 |