1 / 25

CS 551 / 645: Introductory Computer Graphics

CS 551 / 645: Introductory Computer Graphics. David Luebke cs551@cs.virginia.edu http://www.cs.virginia.edu/~cs551. Recap: Z-Buffer Pros. Simple!!! Easy to implement in hardware Polygons can be processed in arbitrary order Easily handles polygon interpenetration

zorina
Download Presentation

CS 551 / 645: Introductory Computer Graphics

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CS 551 / 645: Introductory Computer Graphics David Luebke cs551@cs.virginia.edu http://www.cs.virginia.edu/~cs551 David Luebke 4/2/2014

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

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

  4. 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 4/2/2014

  5. Ray Tracing • An example: Eyepoint Screen Scene David Luebke 4/2/2014

  6. Ray Tracing • An example: Eyepoint Screen Scene David Luebke 4/2/2014

  7. 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 4/2/2014

  8. 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 4/2/2014

  9. 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 4/2/2014

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

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

  12. Conservative Visibility Agorithms • 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 • If the clump is entirely outside the view frustum, don’t render any of the primitives • If the clump intersects the view frustum, render normally • If the clump is entirely within the view frustum, can render with clipping disabled David Luebke 4/2/2014

  13. Efficient View-Frustum Culling • 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 • A general strategy known as hierarchical bounding volumes David Luebke 4/2/2014

  14. Efficient View-Frustum Culling • What shape should bounding volumes be? • Spheres and axis-aligned bounding boxes are simple to calculate and cheap to test • Oriented bounding boxesconverge asymptotically faster in theory • Lots of other volumes have been proposed, but most people still use spheres and AABBs. David Luebke 4/2/2014

  15. Efficient View-Frustum Culling • Where in the pipeline should view-frustum culling be performed? • As early as possible (world coordinates) David Luebke 4/2/2014

  16. 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 4/2/2014

  17. 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 4/2/2014

  18. Cells & Portals A D E F B C G H A E B C D F G H David Luebke 4/2/2014

  19. Cells & Portals A D E F B C G H A E B C D F G H David Luebke 4/2/2014

  20. Cells & Portals A D E F B C G H A E B C D F G H David Luebke 4/2/2014

  21. Cells & Portals A D E F B C G H A E B C D F G H David Luebke 4/2/2014

  22. Cells & Portals A D E F B C G H A E B C D F G H David Luebke 4/2/2014

  23. 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 A D E F B C G H David Luebke 4/2/2014

  24. Overview • Recap: visible surfaces; Z-buffer • Other exact algorithms • BSP trees • Ray casting • Conservative algorithms • View-frustum culling • Cells & portals • Occlusionculling David Luebke 4/2/2014

  25. 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 4/2/2014

More Related