visibility algorithms for computer graphics n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Visibility Algorithms for Computer Graphics PowerPoint Presentation
Download Presentation
Visibility Algorithms for Computer Graphics

Loading in 2 Seconds...

play fullscreen
1 / 40

Visibility Algorithms for Computer Graphics - PowerPoint PPT Presentation


  • 200 Views
  • Uploaded on

Visibility Algorithms for Computer Graphics. CS 551/645 Introduction to Computer Graphics Guest lecture by David Luebke. But First…. CS 551/651: Advanced Computer Graphics I’m teaching next semester Follows and builds on 551/645. Topics: Photorealism: Ray tracing, path tracing, radiosity

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Visibility Algorithms for Computer Graphics' - asher-rose


Download Now An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
visibility algorithms for computer graphics

Visibility Algorithms for Computer Graphics

CS 551/645 Introduction to Computer Graphics

Guest lecture by David Luebke

David Luebke 11-2-98

but first
But First…
  • CS 551/651: Advanced Computer Graphics
    • I’m teaching next semester
    • Follows and builds on 551/645. Topics:
      • Photorealism: Ray tracing, path tracing, radiosity
      • Speed: Occlusion culling, level-of-detail, texture tricks
      • Hardware: rendering pipeline, graphics architectures
      • Non-photorealism: pen-and-ink, painterly rendering
      • Image-based rendering: image warping, sprites, layered-depth images
    • Will also be taught in grad/undergrad formats

David Luebke 11-2-98

overview
Overview
  • Recap: visible surfaces; Z-buffer
  • Other exact algorithms
    • BSP trees
    • Ray tracing
  • Conservative algorithms
    • View-frustum culling
    • Cells & portals
    • Occlusion culling

David Luebke 11-2-98

recap the visible surface problem
Recap: The Visible Surface Problem
  • Problem: Many polygons may map to same pixel on screen.
  • Goal: Correctly color pixels, using only unoccluded polygons
  • Formally, a occludes b if:
    • a and b are on the same projector
    • a is closer to the center of projection

David Luebke 11-2-98

recap painter s algorithm
Recap: Painter’s Algorithm
  • Idea: do what painters do
    • Sort objects by depth
    • Draw objects from distant to near
    • Just overwrite already-drawn objects as you go

David Luebke 11-2-98

recap painter s algorithm1
Recap:Painter’s Algorithm
  • Pros:
    • Simple, fast rasterization
  • Cons:
    • Sorting is O(n lg n), and n can get big
    • Some objects can’t be sorted by depth:

David Luebke 11-2-98

recap z buffer
Recap: Z-Buffer
  • Idea: resolve visibility at each pixel
    • Store depth of nearest polygon at pixel
    • Reset pixel color & depth only if nearer polygon is found
    • Embed this test in rasterization loop
  • Pros: simple, linear-time algorithm
  • Cons: Read-Modify-Write in inner loop demands large, fast, dedicated memory bank (the Z-buffer)

David Luebke 11-2-98

overview1
Overview
  • Recap: visible surfaces; Z-buffer
  • Other exact algorithms
    • BSP trees
    • Ray tracing
  • Conservative algorithms
    • View-frustum culling
    • Cells & portals
    • Occlusion culling

David Luebke 11-2-98

binary space partition bsp trees
Binary Space Partition(BSP) Trees
  • Fuchs et al, 1980
  • Assumptions:
    • Static scene
    • Moving camera
  • Commonly used in 3-D video games (e.g., Quake), but going out of style
  • Still a very powerful, general idea, used in many graphics algorithms

David Luebke 11-2-98

bsp trees
BSP Trees
  • Preprocess: overlay a binary (BSP) tree on objects in the scene
  • Runtime: correctly traversing this tree enumerates objects from back to front
  • Idea: divide space recursively into half-spaces by choosing splitting planes
    • Splitting planes can be arbitrarily oriented
    • Notice: nodes are always convex

David Luebke 11-2-98

bsp trees1
BSP Trees

David Luebke 11-2-98

bsp trees2
BSP Trees

David Luebke 11-2-98

bsp trees3
BSP Trees

David Luebke 11-2-98

bsp trees4
BSP Trees

David Luebke 11-2-98

bsp trees5
BSP Trees

David Luebke 11-2-98

bsp trees rendering
BSP Trees: Rendering

renderBSP(BSPtree *T)

BSPtree *near, far;

if (T is a leaf node)

renderObject(T)

if (eye on left side of T->plane)

near = T->left; far = T->right;

else

near = T->right; far = T->left;

renderBSP(far);

renderBSP(near);

David Luebke 11-2-98

bsp trees rendering1
BSP Trees: Rendering

David Luebke 11-2-98

bsp trees rendering2
BSP Trees: Rendering

David Luebke 11-2-98

bsp trees the catch

Ouch

BSP Trees: The Catch
  • No bunnies were harmed in my example
  • But what if a splitting plane passes through an object?
    • Split the object; give half to each node:
    • Worst case: can create up to O(n3) objects!

David Luebke 11-2-98

overview2
Overview
  • Recap: visible surfaces; Z-buffer
  • Other exact algorithms
    • BSP trees
    • Ray tracing
  • Conservative algorithms
    • View-frustum culling
    • Cells & portals
    • Occlusion culling

David Luebke 11-2-98

ray tracing
Ray Tracing
  • Idea:
    • trace a ray from the eyepoint through the center of each pixel
    • Color pixel according to the first object the ray hits
    • Simple! No need for:
      • Perspective projection matrices
      • Clipping
      • Scan conversion of polygons

David Luebke 11-2-98

ray tracing1
Ray Tracing
  • An example:

Eyepoint

Screen

Scene

David Luebke 11-2-98

ray tracing2
Ray Tracing
  • An example:

Eyepoint

Screen

Scene

David Luebke 11-2-98

ray tracing3
Ray Tracing
  • Two flavors of the algorithm:
    • Ray casting just finds visible surfaces
    • Recursive ray tracing traces additional rays from those surfaces for sophisticated shading
      • Shadows
      • Reflection
      • Refraction

David Luebke 11-2-98

ray tracing the catch
Ray Tracing: The Catch
  • Ray tracing is a simple, powerful way to determine visibility & shading
  • So why don’t we always use it?

David Luebke 11-2-98

ray tracing the catch1
Ray Tracing: The Catch
  • Ray tracing is a simple, powerful way to determine visibility & shading
  • So why don’t we always use it?
  • Too slow!
    • Complexity proportional to # of pixels
    • Typical screen: ~1,000,000 pixels
    • Typical scene:« 1,000,000 polygons

David Luebke 11-2-98

overview3
Overview
  • Recap: visible surfaces; Z-buffer
  • Other exact algorithms
    • BSP trees
    • Ray casting
  • Conservative algorithms
    • View-frustum culling
    • Cells & portals
    • Occlusion culling

David Luebke 11-2-98

conservative algorithms
Conservative Algorithms
  • Rendering with a Z-buffer finds exact visibility of n polygons in O(n) time
  • Conservative visibilityalgorithms quickly compute a potentially visible set of v polygons, v « n
    • v = all visible polygons + a few others
  • Z-buffer can then render this set in O(v) time

David Luebke 11-2-98

view frustum culling
View-frustum culling
  • Simple way to quickly reject many polygons at once:
    • Associate simple bounding volumes (e.g., spheres) with each object
    • Before rendering object, test its bounding volume for visibility

PotentiallyVisible

Not Visible

David Luebke 11-2-98

overview4
Overview
  • Recap: visible surfaces; Z-buffer
  • Other exact algorithms
    • BSP trees
    • Ray casting
  • Conservative algorithms
    • View-frustum culling
    • Cells & portals
    • Occlusion culling

David Luebke 11-2-98

cells portals
Cells & Portals
  • Goal: walk through architectural models (buildings, cities, catacombs…)
  • These divide naturally into cells
    • Rooms, alcoves, corridors…
  • Transparent portalsconnect cells
    • Doorways, entrances, windows…
  • Key observation: cells only see each other through portals!

David Luebke 11-2-98

cells portals1
Cells & Portals
  • Idea:
    • Create an adjacency graphof cells
    • Starting with cell containing eyepoint, traverse graph, rendering visible cells
    • A cell is only visible if it can be seen through a sequence of portals
      • Need a line of sight
      • So cell visibility reduces to testing portal sequences…

David Luebke 11-2-98

cells portals2
Cells & Portals

A

D

E

F

B

C

G

H

A

E

B

C

D

F

G

H

David Luebke 11-2-98

cells portals3
Cells & Portals

A

D

E

F

B

C

G

H

A

E

B

C

D

F

G

H

David Luebke 11-2-98

cells portals4
Cells & Portals

A

D

E

F

B

C

G

H

A

E

B

C

D

F

G

H

David Luebke 11-2-98

cells portals5
Cells & Portals

A

D

E

F

B

C

G

H

A

E

B

C

D

F

G

H

David Luebke 11-2-98

cells portals6
Cells & Portals

A

D

E

F

B

C

G

H

A

E

B

C

D

F

G

H

David Luebke 11-2-98

cells portals7

A

D

E

F

B

C

G

H

Cells & Portals
  • Can even figure out which cells a particular cell will never see:

Ex: H will never see F; B can only see H

  • This can further speed up culling

David Luebke 11-2-98

overview5
Overview
  • Recap: visible surfaces; Z-buffer
  • Other exact algorithms
    • BSP trees
    • Ray casting
  • Conservative algorithms
    • View-frustum culling
    • Cells & portals
    • Occlusionculling

David Luebke 11-2-98

occlusion culling
Occlusion Culling
  • When cells and portals don’t work…
    • Trees in a forest
    • A crowded train station
  • Need general occlusion culling algs:
    • Dynamic scenes, aggregate occluders
    • Open problem, little work so far:
      • Hierarchical Z-Buffer (Greene 93)
      • Hierarchical Occlusion Maps (Zhang 97)

David Luebke 11-2-98