Visibility II CS 446: Real-Time Rendering & Game Technology

Slides:



Advertisements
Similar presentations
Collisions and Intersections When objects move, test for collision. When projecting surfaces, check for intersections. (Many slides adapted from Amitabh.
Advertisements

Advanced Light and Shadow Culling Methods Eric Lengyel.
Computer Graphics Inf4/MSc Computer Graphics Lecture 9 Visible Surface Determination.
Visibility Culling David Luebke Computer Science Department University of Virginia
Visibility in Games Harald Riegler. 2 / 18 Visibility in Games n What do we need it for? u Increase of rendering speed by removing unseen scene data from.
David Luebke5/11/2015 CS 551 / 645: Introductory Computer Graphics David Luebke
Occlusion Culling Fall 2003 Ref: GamasutraGamasutra.
Visibility in Computer Graphics Toni Sellarès Unversitat de Girona
Visibility Culling. Back face culling View-frustrum culling Detail culling Occlusion culling.
Visibility Culling Back face culling View-frustrum culling Detail culling Occlusion culling.
Visibility Culling using Hierarchical Occlusion Maps Hansong Zhang, Dinesh Manocha, Tom Hudson, Kenneth E. Hoff III Presented by: Chris Wassenius.
Week 14 - Monday.  What did we talk about last time?  Bounding volume/bounding volume intersections.
Object-Space Visibility Culling Anthony Steed University College London Based upon material presented by Claudio T. Silva at Eurographics 1999 Slides,
Chapter 6: Vertices to Fragments Part 2 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley Mohan Sridharan Based on Slides.
Tomas Mőller © 2000 Speeding up your game The scene graph Culling techniques Level-of-detail rendering (LODs) Collision detection Resources and pointers.
Tomas Mőller © 2000 Speed-up Techniques for Real-Time Rendering or “What makes your real-time video game fly” Tomas Möller Chalmers University of Technology,
Advanced Data Structures for Games and Graphics Lecture 4
1 From-Point Occlusion Culling From-Point Occlusion Culling Chapter 23.
Fall 2006 revised1 Frustum Culling in OpenGL Ref: MarkMoley.com.
Ray Space Factorization for From-Region Visibility Authors: Tommer Leyvand, Olga Sorkine, Daniel Cohen-Or Presenter: Alexandre Mattos.
10/11/2001CS 638, Fall 2001 Today Kd-trees BSP Trees.
10/02/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Octrees.
Hidden Surface Removal
1 Occlusion Culling ©Yiorgos Chrysanthou, , Anthony Steed, 2004.
Afrigraph 2004 Massive model visualization Tutorial A: Part I Rasterization Based Approaches Andreas Dietrich Computer Graphics Group, Saarland University.
Computer Graphics 2 Lecture x: Acceleration Techniques for Ray-Tracing Benjamin Mora 1 University of Wales Swansea Dr. Benjamin Mora.
10/29/02 (c) 2002 University of Wisconsin, CS559 Today Hidden Surface Removal Exact Visibility.
Spatial Data Structures Jason Goffeney, 4/26/2006 from Real Time Rendering.
10/09/2001CS 638, Fall 2001 Today Spatial Data Structures –Why care? –Octrees/Quadtrees –Kd-trees.
The Visibility Problem In many environments, most of the primitives (triangles) are not visible most of the time –Architectural walkthroughs, Urban environments.
10/16/2001CS 638, Fall 2001 Today Visibility –Overview –Cell-to-Cell –Cell-to-Region –Eye-To-Region –Occlusion Culling (maybe)
CSE 381 – Advanced Game Programming Quickhull and GJK.
Culling Techniques “To cull” means “to select from group” In graphics context: do not process data that will not contribute to the final image The “group”
CSL 859: Advanced Computer Graphics Dept of Computer Sc. & Engg. IIT Delhi.
Visibility Culling David Luebke Computer Science Department University of Virginia
Computer Graphics 2 Lecture 8: Visibility Benjamin Mora 1 University of Wales Swansea Pr. Min Chen Dr. Benjamin Mora.
Visibility Culling III: Image-Space Occlusion David Luebke Computer Science Department University of Virginia
Real-Time Rendering SPEEDING UP RENDERING Lecture 04 Marina Gavrilova.
Visible-Surface Detection Jehee Lee Seoul National University.
Visibility III: Occlusion Queries CS 446: Real-Time Rendering & Game Technology David Luebke University of Virginia.
1 Advanced Scene Management. 2 This is a game-type-oriented issue Bounding Volume Hierarchies (BVHs) Binary space partition trees (BSP Trees) “Quake”
Visibility Culling II: Beyond Cells & Portals David Luebke Computer Science Department University of Virginia
Visibility CS 446: Real-Time Rendering & Game Technology David Luebke University of Virginia.
Occlusion Query. Content Occlusion culling Collision detection (convex) Etc. Fall
Real-time Graphics for VR Chapter 23. What is it about? In this part of the course we will look at how to render images given the constrains of VR: –we.
1Computer Graphics Implementation II Lecture 16 John Shearer Culture Lab – space 2
Implementation II.
1 Visiblity: Culling and Clipping Computer Graphics COMP 770 (236) Spring 2009 January 21 & 26: 2009.
David Luebke11/26/2015 CS 551 / 645: Introductory Computer Graphics David Luebke
10/07/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Spatial data structures.
CSCE 552 Spring D Models By Jijun Tang. Triangles Fundamental primitive of pipelines  Everything else constructed from them  (except lines and.
Recap: General Occlusion Culling l When cells and portals don’t work… –Trees in a forest –A crowded train station l Need general occlusion culling algorithms:
Coherent Hierarchical Culling: Hardware Occlusion Queries Made Useful Jiri Bittner 1, Michael Wimmer 1, Harald Piringer 2, Werner Purgathofer 1 1 Vienna.
Where We Stand At this point we know how to: –Convert points from local to window coordinates –Clip polygons and lines to the view volume –Determine which.
Computer Graphics I, Fall 2010 Implementation II.
Maths & Technologies for Games Spatial Partitioning 1 CO3303 Week 8-9.
DPL2/10/2016 CS 551/651: Final Review David Luebke
1 CSCE 441: Computer Graphics Hidden Surface Removal Jinxiang Chai.
01/28/09Dinesh Manocha, COMP770 Visibility Computations Visible Surface Determination Visibility Culling.
Hierarchical Occlusion Map Zhang et al SIGGRAPH 98.
Computer Graphics Inf4/MSc 1 Computer Graphics Lecture 5 Hidden Surface Removal and Rasterization Taku Komura.
David Luebke 3/5/2016 Advanced Computer Graphics Lecture 4: Faster Ray Tracing David Luebke
Engine Basics: Optimizing Geometry CS 446: Real-Time Rendering & Game Technology David Luebke University of Virginia.
Occlusion Culling David Luebke University of Virginia.
CS 445: Introduction to Computer Graphics David Luebke University of Virginia Visibility Calculations and Occlusion Culling.
Visible-Surface Detection Methods. To identify those parts of a scene that are visible from a chosen viewing position. Surfaces which are obscured by.
Today Visibility Overview Cell-to-Cell Cell-to-Region Eye-To-Region
Conservative Visibility Preprocessing using Extended Projections Frédo Durand, George Drettakis, Joëlle Thollot and Claude Puech iMAGIS-GRAVIR/IMAG-INRIA.
CS 551 / 645: Introductory Computer Graphics
Presentation transcript:

Visibility II CS 446: Real-Time Rendering & Game Technology David Luebke University of Virginia

Demo Time: Matt Spear NOTE: I’ve reorganized the next few demos: Feb 21: Paul Tschirhart Feb 23: Erin Golub Feb 28: Sean Arietta Mar 2: Jiayuan Meng If this is a problem, let me know! Real-Time Rendering 2 David Luebke

Assignment 3 Go over it Groups will be assigned before C.O.B. today… Give your preferences on the forum! Feel free to augment these by saying what you like about each idea Real-Time Rendering 3 David Luebke

Recap: Visibility Calculations Motivation: avoid rendering redundant geometry Huge speedup, especially for indoor environments Basic idea: don’t render what can’t be seen Off-screen: view-frustum culling Occluded by other objects: occlusion culling Real-Time Rendering 4 David Luebke

Recap: Potentially Visible Set Our goal: quickly eliminate large portions of the scene which will not be visible in the final image Not the exact visibility solution, but a quick-and-dirty conservative estimate of which primitives may be visible Z-buffer& clip this for the exact solution This conservative estimate is called the potentially visible set or PVS Real-Time Rendering 5 David Luebke

Recap: Cells & Portals Occlusion culling technique specialized for architectural models (buildings, cities, catacombs) These divide naturally into cells Rooms, alcoves, corridors… Transparent portals connect cells Doorways, entrances, windows… Notice: cells only see other cells through portals Real-Time Rendering 6 David Luebke

Cells & Portals Idea: Cells form the basic unit of PVS 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 So cell visibility reduces to testing portal sequences for a line of sight… Real-Time Rendering 7 David Luebke

Cells & Portals A D E F B C G H A E B C D F G H Real-Time Rendering 8 David Luebke

Cells & Portals A D E F B C G H A E B C D F G H Real-Time Rendering 9 David Luebke

Cells & Portals A D E F B C G H A E B C D F G H Real-Time Rendering 10 David Luebke

Cells & Portals A D E F B C G H A E B C D F G H Real-Time Rendering 11 David Luebke

Cells & Portals A D E F B C G H A E B C D F G H Real-Time Rendering 12 David Luebke

? Cells & Portals A D E F B C G H A E B C D F G H ? Real-Time Rendering 13 David Luebke

Cells & Portals A D H F C B E G X Real-Time Rendering 14 David Luebke

Cells & Portals View-independent solution: find all cells a particular cell could possibly see: C can only see A, D, E, and H A D H F C B E G A D E H Real-Time Rendering 15 David Luebke

Cells & Portals View-independent solution: find all cells a particular cell could possibly see: H will never see F A D H F C B E G A D E B C G Real-Time Rendering 16 David Luebke

Cells and Portals Questions: The key insight: How can we detect whether a given cell is visible from a given viewpoint? How can we detect view-independent visibility between cells? The key insight: These problems reduce to eye-portal and portal-portal visibility Real-Time Rendering 17 David Luebke

Recap: “Luebke/Georges” algorithm Depth-first adjacency graph traversal Render cell containing viewer Treat portals as special polygons If portal is visible, render adjacent cell But clip to boundaries of portal! Recursively check portals in that cell against new clip boundaries (and render) Each visible portal sequence amounts to a series of nested portal boundaries Kept implicitly on recursion stack Real-Time Rendering 18 David Luebke

Recap: “Luebke/Georges” algorithm Recursively rendering cells while clipping to portal boundaries is not new Visible-surface algorithm (Jones 1971): general polygon-polygon clipping Elegant, expensive, complicated Conservative overestimate (pfPortals): use portal’s cull box Cull box = x-y screenspace bounding box Cheap to compute, very cheap to intersect Real-Time Rendering 19 David Luebke

Recap: “Luebke/Georges” algorithm How badly does the cull box approximation overestimate PVS? A: Not much for most architectural scenes Note: Can implement mirrors as portals with an extra transformation! Some clipping & Z-buffering issues Must limit recursion Real-Time Rendering 20 David Luebke

Cells & Portals: Old Skool Show the video… Real-Time Rendering 21 David Luebke

Creating Cells and Portals Given a model, how might you extract the cells and portals? Airey: k-D tree (axis-aligned boxes) Teller: BSP tree (general convex cells) Luebke: modeler/level designer (arbitrary cells) Problems and issues Running time Free cells Intra-wall cells Real-Time Rendering 22 David Luebke

Cells and Portals: Discussion Good solution for most architectural models Use the simplest algorithm that suffices for your needs: pfPortals-style algorithm: lightweight view-dependent solution, reasonably tight PVS, no preprocess necessary (except partition) Teller-style algorithm: even tighter PVS, somewhat more complex, can provide view-independent solution for prefetching Real-Time Rendering 23 David Luebke

General Occlusion Culling Clearly cells and portals don’t work for all models… Trees in a forest A crowded train station Other specialized visibility algorithms exist From colonoscopy to cityscapes… Need general occlusion culling algorithms: Aggregate occlusion Dynamic scenes Non-polygonal scenes Real-Time Rendering 24 David Luebke

Image-Space Occlusion Culling Many general occlusion culling algorithms use an image-space approach Idea: solve visibility in 2D, on the image plane Real-Time Rendering 25 David Luebke

Hierarchical Z-Buffer Replace Z-buffer with a Z-pyramid Lowest level: full-resolution Z-buffer Higher levels: each pixel represents the max depth of the four pixels “underneath” it Basic idea: hierarchical rasterization of the polygon, with early termination where polygon is occluded Real-Time Rendering 26 David Luebke

Hierarchical Z-Buffer Idea: test polygon against highest level first If polygon is further than distance recorded in pixel, stop—it’s occluded If polygon is closer, recursively check against next lower level If polygon is visible at lowest level, set new distance value and propagate up Real-Time Rendering 27 David Luebke

Hierarchical Z-Buffer Z-pyramid exploits image-space coherence: Polygon occluded in a pixel is probably occluded in nearby pixels HZB also exploits object-space coherence Polygons near an occluded polygon are probably occluded Real-Time Rendering 28 David Luebke

Hierarchical Z-Buffer Exploiting object-space coherence: Subdivide scene with an octree All geometry in an octree node is contained by a cube Before rendering the contents of a node, “test render” the faces of its cube (i.e., query the Z-pyramid) If cube faces are occluded, ignore the entire node Real-Time Rendering 29 David Luebke

Hierarchical Z-Buffer HZB can exploit temporal coherence Most polygons affecting the Z-buffer last frame will affect Z-buffer this frame HZB also operates at max efficiency when Z-pyramid already built So start each frame by rendering octree nodes visible last frame Real-Time Rendering 30 David Luebke

Hierarchical Z-Buffer: Discussion HZB needs hardware support to be really competitive Hardware vendors haven’t entirely bought in: Z-pyramid (and hierarchies in general) a pain in hardware Unpredictable Z-query times generate bubbles in rendering pipe But we’re getting there… ATI HyperZ Similar technology in NVIDIA Both “under the hood”, not exposed to programmer At the user level, hardware now supports occlusion queries Real-Time Rendering 31 David Luebke

Modern Occlusion Culling Support from hardware would be nice Want an “occlusion test”: would this polygon be visible if I rendered it? How could you use such a test? Test portal polygons before rendering adjacent cell Test object bounding boxes before rendering object Yay! GL_HP_OCCLUSION_TEST extension Problems: CPU/GPU synchronization == bad Might want to know “how visible” is the polygon Real-Time Rendering 32 David Luebke

Modern Occlusion Culling GL_ARB_OCCLUSION_QUERY to the rescue Non-blocking query “Is this occlusion query done yet?” Multiple queries in flight Returns number of fragments visible Note: can actually render object or not Still lots of issues for efficient culling Real-Time Rendering 33 David Luebke

111 uses for Occlusion Queries Occlusion culling (duh) Others? Approximate culling LOD size estimation Lens flare effects Transparency Collision detection (!) Convergence testing Real-Time Rendering 34 David Luebke