Presentation is loading. Please wait.

Presentation is loading. Please wait.

David Luebke11/26/2015 CS 551 / 645: Introductory Computer Graphics David Luebke

Similar presentations


Presentation on theme: "David Luebke11/26/2015 CS 551 / 645: Introductory Computer Graphics David Luebke"— Presentation transcript:

1 David Luebke11/26/2015 CS 551 / 645: Introductory Computer Graphics David Luebke cs551@cs.virginia.edu http://www.cs.virginia.edu/~cs551

2 David Luebke11/26/2015 Recap: Z-Buffer Pros l Simple!!! l Easy to implement in hardware l Polygons can be processed in arbitrary order l Easily handles polygon interpenetration l Enables deferred shading –Rasterize shading parameters (e.g., surface normal) and only shade final visible fragments –When does this help?

3 David Luebke11/26/2015 Recap: Z-Buffer Cons l Lots of memory (e.g. 1280x1024x32 bits) l Read-Modify-Write in inner loop requires fast memory l Hard to do analytic antialiasing l Hard to simulate translucent polygons l Precision issues (scintillating, worse with perspective projection)

4 David Luebke11/26/2015 Ray Tracing l 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: n Perspective projection matrices n Clipping n Scan conversion of polygons

5 David Luebke11/26/2015 Ray Tracing l An example: ScreenEyepointScene

6 David Luebke11/26/2015 Ray Tracing l An example: ScreenEyepointScene

7 David Luebke11/26/2015 Ray Tracing l Two flavors of the algorithm: –Ray casting just finds visible surfaces –Recursive ray tracing traces additional rays from those surfaces for sophisticated shading n Shadows n Reflection n Refraction

8 David Luebke11/26/2015 Ray Tracing: The Catch l Ray tracing is a simple, powerful way to determine visibility & shading l So why don’t we always use it?

9 David Luebke11/26/2015 Ray Tracing: The Catch l Ray tracing is a simple, powerful way to determine visibility & shading l So why don’t we always use it? l Too slow! –Complexity proportional to # of pixels –Typical screen: ~1,000,000 pixels –Typical scene:« 1,000,000 polygons

10 David Luebke11/26/2015 Visibility Algorithms l The Z-buffer is an image-space algorithm –Takes place at the end of the pipeline, in screen- space coordinates l BSP Trees are an object-space algorithm –Takes place in world-space coordinates l Warnock’s algorithm is a hybrid –Uses both screen-space and object-space information l How would you classify ray casting?

11 David Luebke11/26/2015 Visibility Algorithms l The 70’s were the decade of analytic object- space algorithms l In the mid-80’s, memory got cheap enough that Z-buffers became the practical choice l Then history repeated itself… l Next up: conservative visibility algorithms for reducing load from the front end of the rendering pipeline

12 David Luebke11/26/2015 Conservative Visibility Agorithms l View-frustum culling –Organize primitives into clumps with a simple bounding volume –Before rendering the primitives in a clump, test its bounding volume against the view frustum n If the clump is entirely outside the view frustum, don’t render any of the primitives n If the clump intersects the view frustum, render normally n If the clump is entirely within the view frustum, can render with clipping disabled

13 David Luebke11/26/2015 Efficient View-Frustum Culling l How big should the clumps be? –Choose minimum size so: cost testing bounding volume << cost clipping primitive –Organize bounding volumes into a hierarchy for more efficient testing n A general strategy known as hierarchical bounding volumes

14 David Luebke11/26/2015 Efficient View-Frustum Culling l What shape should bounding volumes be? –Spheres and axis-aligned bounding boxes are simple to calculate and cheap to test –Oriented bounding boxes converge asymptotically faster in theory –Lots of other volumes have been proposed, but most people still use spheres and AABBs.

15 David Luebke11/26/2015 Efficient View-Frustum Culling l Where in the pipeline should view-frustum culling be performed? –As early as possible (world coordinates)

16 David Luebke11/26/2015 Cells & Portals l Goal: walk through architectural models (buildings, cities, catacombs…) l These divide naturally into cells –Rooms, alcoves, corridors… l Transparent portals connect cells –Doorways, entrances, windows… l Key observation: cells only see each other through portals!

17 David Luebke11/26/2015 Cells & Portals l Idea: –Create an adjacency graph of 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 n Need a line of sight n So cell visibility reduces to testing portal sequences…

18 David Luebke11/26/2015 Cells & Portals A D H F CB E G H BCDFG EA

19 David Luebke11/26/2015 Cells & Portals A D H F CB E G H BCDFG EA

20 David Luebke11/26/2015 Cells & Portals A D H F CB E G H BCDFG EA

21 David Luebke11/26/2015 Cells & Portals A D H F CB E G H BCDFG EA

22 David Luebke11/26/2015 Cells & Portals A D H F CB E G H BCDFG EA

23 David Luebke11/26/2015 Cells & Portals l Can even figure out which cells a particular cell will never see: Ex: H will never see F; B can only see H l This can further speed up culling A D H F CB E G

24 David Luebke11/26/2015 Overview l Recap: visible surfaces; Z-buffer l Other exact algorithms –BSP trees –Ray casting l Conservative algorithms –View-frustum culling –Cells & portals –Occlusion culling

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


Download ppt "David Luebke11/26/2015 CS 551 / 645: Introductory Computer Graphics David Luebke"

Similar presentations


Ads by Google