Docsity

Visible Surface Algorithms - Lecture Slides | CS 5501, Study notes of Computer Science

Toggle sidebar
bg1
1
David Luebke 5/7/00
CS 551 / 645:
Introductory Computer Graphics
Review for Final
David Luebke 5/7/00
Administrivia
O
Hand back assignment 4
O
Questions about assignment 5?
–Intel?
– Playability versus algorithms?
Model courtesy of InfoGrap hica
David Luebke 5/7/00
Final Examination
O
Time/place:
– Tuesday, May 9 from 2:00 to 5:00 PM
–MEC 214
O
Cumulative over entire semester
O
Will design for about 2 ho urs
O
Questions on format?
David Luebke 5/7/00
Visible-Surface Algorithms
O
Backface culling:
– On the surface of a closed manifold, polygons
whose nor mals point away f rom the camera are
always occluded:
Note: backface culling
alone doesn’t solve the
hidden-surface problem!
David Luebke 5/7/00
Painter’s Algorithm
O
Simple approach: render the polygons from
back to front, “painting over” previous polygons:
– Draw blue, then green, then orange
David Luebke 5/7/00
Painter’s Algorithm: Problems
O
Intersecting polygons
present a problem
O
Even non-intersecting polygons can form a
cycle with no valid visib ility order:
pf3
pf4
pf5
pf8
pf9

Partial preview of the text

Download Visible Surface Algorithms - Lecture Slides | CS 5501 and more Study notes Computer Science in PDF only on Docsity!

David Luebke 5/7/

CS 551 / 645:

Introductory Computer Graphics

Review for Final

David Luebke 5/7/

Administrivia

O Hand back assignment 4

O Questions about assignment 5?

  • Intel?
  • Playability versus algorithms?

Model courtesy of InfoGraphica

David Luebke 5/7/

Final Examination

O Time/place:

  • Tuesday, May 9 from 2:00 to 5:00 PM
  • MEC 214

O Cumulative over entire semester

O Will design for about 2 hours

O Questions on format?

David Luebke 5/7/

Visible-Surface Algorithms

O Backface culling:

  • On the surface of a closed manifold, polygonswhose normals point away from the camera are

always occluded:

Note: backface culling

hidden-surface problem!alone doesn’t solve the

David Luebke 5/7/

Painter’s Algorithm

O Simple approach: render the polygons from

back to front, “painting over” previous polygons:

  • Draw blue, then green, then orange David Luebke 5/7/

Painter’s Algorithm: Problems

O Intersecting polygons present a problem

O Even non-intersecting polygons can form a

cycle with no valid visibility order:

David Luebke 5/7/

Analytic Visibility Algorithms

O Analytic visibility algorithms

  • Computed fragments exactly
  • Expensive! O(n 2 ) fragments possible:

O Example: BSP Trees

  • Recursively subdivide space into half-spaces,

then render in back-to-front order

  • Pros: enables painter’s algorithm
  • Cons:
Q Relatively long preprocess stage
Q Splitting increases polygon count: worst case O(and space requirements n 3 ) time

David Luebke 5/7/

Z-Buffer

O Z-buffer or Depth Buffer

  • Computes visibility independently at every pixel

David Luebke 5/7/

Z-Buffer

O Pros:

  • Simple, easy to implement in hardware
  • Polygons can be processed in arbitrary order
  • Handles polygon interpenetration and cycles

O Cons:

  • Lots of memory
  • Lots of memory access in inner loop of rasterizer
  • Hard to do transparency
  • Hard to do analytic antialiasing
  • Precision issues David Luebke 5/7/

Conservative Visibility Culling

O Idea: computepotentially visible set (PVS)

and let exact algorithms take it from there

O View-frustum culling

  • Hierarchical bounding volumes

O Cells and portals

  • Ideal for architectural models:
  • Idea: PVS calculation reduces tofinding sightlines through portals
  • View-dependent versus view-independentsolutions

David Luebke 5/7/

General Occlusion Culling

O When cells and portals don’t work…

  • Trees in a forest
  • A crowded train station O Need generalocclusion culling algorithms:
  • Aggregate occlusion
  • Dynamic scenes

David Luebke 5/7/

Hierarchical Z-Buffer

O Image-space coherence: Z-pyramid

O Object-space coherence: octree

O Temporal coherence: visible-last-frame list

O Pros:

  • Simple, elegant, powerful idea

O Cons:

  • Requires hardware support, but hard to fit intocurrent hardware pipelines

O Promising trend: hardware Z-query operation

David Luebke 5/7/

Texture Map Antialiasing

O Texel size >= pixel size:

– Usetexels when looking up pixel in mapbilinear interpolation to average 4 nearest

O Texel size < pixel size:

– Pixel covers many texels

– Approach: blur the image under the pixel,averaging the contributions of the covered texels

– MIP-versions of the texture that incorporate thismapping: pre-calculate lower-esolution

averaging

David Luebke 5/7/

MIP-Mapping

O Generating a MIP-map from a texture is easy

– For each texel in levelthe four corresponding texels in level i , average the values of i -

O If a texture requires n bytes of storage, how

much storage will a MIP-map require?

David Luebke 5/7/

Using MIP-Maps

O Find appropriate level and perform bi-linear

interpolation on the pre-blurred texture

O Even better: find two nearest-to-appropriate

levels and performtri-linear interpolation

O Pros:

– Much better than naïve texture mapping

– Relatively easy to implement in hardware

O Cons:

– Lots of memory lookups per pixel

– Assumes texture compressed equally inu andv

David Luebke 5/7/

Advanced Mapping Techniques

O Bump maps

– Requires per-pixel lighting (Phong shading)

O Displacement maps

– Not practical in standard polygon pipeline

O Illumination or light maps

– How are light maps unlike normal textures?

O Shadow maps

O 3-D textures

David Luebke 5/7/

Ray Tracing

O Our first look at aglobal illumination method

– What makes it global?

O Recursive ray tracing: a simple idea that

addresses:

– Visible surface determination

– Reflection/refraction

– Shadows

David Luebke 5/7/

Ray Tracing Fundamentals

O Represent ray parametrically:

O Find intersections by plugging

inx,y,z and solving fort

– Ray-sphere intersection (don’t need the details)

– Ray-polygon intersection (know the details)

Q Q Find equation of plane containing polygonIntersect ray with plane
Q Test point of intersection: inside polygon?

R = O + t D

David Luebke 5/7/

Shadow Rays

O From point of intersection

  • Test ray to each light source.
  • If ray is blocked, light is shadowed -- ignore it

O Problems with shadow rays

  • Expensive! (light buffer algorithm)
  • Infinitely sharp (sample across area light sources)
  • Semitransparent object shadows (no goodsolution)

David Luebke 5/7/

Accelerating Ray Tracing

O Hierarchical bounding volumes

  • Spheres, AABBs, assorted others

O Spatial partitions

  • Grids, octrees, BSP trees, assorted others

O Reordering ray intersection tests

  • Shadow cache

David Luebke 5/7/

Level of Detail

O Traditional approach: createlevels of detail

(LODs) of each object in a preprocess:

50 Vertices 500 Vertices 2000 Vertices

Model courtesy of InfoGraphica (^) David Luebke 5/7/

Level of Detail: Traditional LOD

O Distant objects use coarser LODs:

David Luebke 5/7/

LOD Mechanisms

O Four basic polygon elision mechanisms:

  • Sample-and-reconstruct
  • Decimation
  • Vertex-merging
  • Adaptive subdivision

David Luebke 5/7/

Dynamic LOD

O Instead of creating LODs in preprocess,

create data structure that can extract desired

LOD at run time

O Pros:

  • Better granularity = better fidelity
  • Better granularity = smoother transitions
  • Supports view-dependent LOD

O Cons:

  • Doesn’t fit modern hardware as well: can’t easily

create display lists or triangle strips (3-5X slower)

David Luebke 5/7/

Vertex Tree Example

9

8 10

4 5

6

1 2 7 4 5 6 8 9

10 B C

I 3

II

R A 3 B

A

Triangles in active list Vertex tree^ David Luebke 5/7/

Vertex Tree Example

10

1 2 7 4 5 6 8 9

10 C

I 3

II

R A 3 B

8

(^9) A B

Triangles in active list Vertex tree

David Luebke 5/7/

Vertex Tree Example

10

1 2 7 4 5 6 8 9

10 C

I 3

II

R A 3 B

C

8

(^9) A B

Triangles in active list Vertex tree David Luebke 5/7/

Vertex Tree Example

10

1 2 7 4 5 6 8 9

10

I 3

II

R A 3 B

C A B C

Triangles in active list Vertex tree

David Luebke 5/7/

Vertex Tree Example

II (^10)

1 2 7 4 5 6 8 9

10

I 3

R A 3 B

C (^) II A B C

Triangles in active list Vertex tree David Luebke 5/7/

Vertex Tree Example

10

1 2 7 4 5 6 8 9

10 C

I 3

R A

B

II A B

II

Triangles in active list Vertex tree

David Luebke 5/7/

Vertex Tree Example

1 2 7 4 5 6 8 9

10 C 3

R

B

II I

A 10 A B

I II

Triangles in active list Vertex tree^ David Luebke 5/7/

Vertex Tree Example

1 2 7 4 5 6 8 9

10 A C 3

R

B

II I B

I II

Triangles in active list Vertex tree

David Luebke 5/7/

Vertex Tree Example

1 2 7 4 5 6 8 9

10 A C 3

R

R B

II I B

I II

Triangles in active list Vertex tree David Luebke 5/7/

Vertex Tree Example

1 2 7 4 5 6 8 9

10 A B C

I 3

R II

R

Triangles in active list Vertex tree

David Luebke 5/7/

The Vertex Tree:

Tris and Subtris

(^31)

2 9

8 7 10

4 5

(^6 )

8 10

4 5

6

A 3

Fold Node A
Unfold Node A

Node->Tris : triangles that change shape upon folding

Node->Subtris : triangles that disappear completely

David Luebke 5/7/

Gaze-Directed LOD

O Show the movie…