Occlusion Query. Content Occlusion culling Collision detection (convex) Etc. Fall 20132.

Slides:



Advertisements
Similar presentations
CS 352: Computer Graphics Chapter 7: The Rendering Pipeline.
Advertisements

Optimized Stencil Shadow Volumes
CSL 859: Advanced Computer Graphics Dept of Computer Sc. & Engg. IIT Delhi.
Occlusion Culling Fall 2003 Ref: GamasutraGamasutra.
Lecture Fall 2001 Visibility Back-Face Culling Painter’s Algorithm.
CHAPTER 12 Height Maps, Hidden Surface Removal, Clipping and Level of Detail Algorithms © 2008 Cengage Learning EMEA.
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.
Korea Univ. Graphics Lab. 3D Game Engine Design Chapter 12. Spatial Sorting Chung Ji Hye
Object-Space Visibility Culling Anthony Steed University College London Based upon material presented by Claudio T. Silva at Eurographics 1999 Slides,
黃聰賢. Light Position Mesh Polygon Shadow Polygon  Clear color buffer and stencil buffer  Render the scene with ambient only.
Rasterization and Ray Tracing in Real-Time Applications (Games) Andrew Graff.
Chapter 6: Vertices to Fragments Part 2 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley Mohan Sridharan Based on Slides.
Vertices and Fragments I CS4395: Computer Graphics 1 Mohan Sridharan Based on slides created by Edward Angel.
Tomas Mőller © 2000 Speeding up your game The scene graph Culling techniques Level-of-detail rendering (LODs) Collision detection Resources and pointers.
Introduction to Volume Rendering Presented by Zvi Devir.
Shadow Silhouette Maps Pradeep Sen, Mike Cammarano, Pat Hanrahan Stanford University.
Adapted from: CULLIDE: Interactive Collision Detection Between Complex Models in Large Environments using Graphics Hardware Naga K. Govindaraju, Stephane.
Final Gathering on GPU Toshiya Hachisuka University of Tokyo Introduction Producing global illumination image without any noise.
Z-Buffer Optimizations Patrick Cozzi Analytical Graphics, Inc.
University of Texas at Austin CS 378 – Game Technology Don Fussell CS 378: Computer Game Technology Beyond Meshes Spring 2012.
09/18/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Bump Mapping Multi-pass algorithms.
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.
Shadows Computer Graphics. Shadows Shadows Extended light sources produce penumbras In real-time, we only use point light sources –Extended light sources.
Computer Graphics Mirror and Shadows
Direct Illumination with Lazy Visibility Evaluation David Hart Philip Dutré Donald P. Greenberg Cornell University SIGGRAPH 99.
Ray Tracing Primer Ref: SIGGRAPH HyperGraphHyperGraph.
Ray Tracing and Photon Mapping on GPUs Tim PurcellStanford / NVIDIA.
NVIDIA PROPRIETARY AND CONFIDENTIAL Occlusion (HP and NV Extensions) Ashu Rege.
Visibility Queries Using Graphics Hardware Presented by Jinzhu Gao.
The Visibility Problem In many environments, most of the primitives (triangles) are not visible most of the time –Architectural walkthroughs, Urban environments.
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”
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
CS 638, Fall 2001 Multi-Pass Rendering The pipeline takes one triangle at a time, so only local information, and pre-computed maps, are available Multi-Pass.
1 Shadows (2) ©Anthony Steed Overview n Shadows – Umbra Recap n Penumbra Analytical v. Sampling n Analytical Aspect graphs Discontinuity meshing.
Visibility III: Occlusion Queries CS 446: Real-Time Rendering & Game Technology David Luebke University of Virginia.
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.
David Luebke11/26/2015 CS 551 / 645: Introductory Computer Graphics David Luebke
09/16/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Environment mapping Light mapping Project Goals for Stage 1.
Emerging Technologies for Games Deferred Rendering CO3303 Week 22.
Computer Graphics Blending CO2409 Computer Graphics Week 14.
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.
Ray Tracing Fall, Introduction Simple idea  Forward Mapping  Natural phenomenon infinite number of rays from light source to object to viewer.
Visibility II CS 446: Real-Time Rendering & Game Technology
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.
Honours Graphics 2008 Session 5. Today’s focus Rasterization Visibility determination Coarse / fine visibility determination.
1 CSCE 441: Computer Graphics Hidden Surface Removal Jinxiang Chai.
Shadows David Luebke University of Virginia. Shadows An important visual cue, traditionally hard to do in real-time rendering Outline: –Notation –Planar.
Hierarchical Occlusion Map Zhang et al SIGGRAPH 98.
09/23/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Reflections Shadows Part 1 Stage 1 is in.
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.
Scene Manager Creates and places movable objects like lights and cameras so as to access them efficiently, e.g. for rendering. Loads and assembles world.
Real-Time Soft Shadows with Adaptive Light Source Sampling
CSC418 Computer Graphics Back Faces Visibility Algorithms.
Patrick Cozzi University of Pennsylvania CIS Fall 2013
Ray Tracing Dr. Scott Schaefer.
The Graphics Rendering Pipeline
Understanding Theory and application of 3D
View-Dependent Textured Splatting for Rendering Live Scenes
CSCE 441: Computer Graphics Hidden Surface Removal
UMBC Graphics for Games
Visibility (hidden surface removal)
Accelerating k+-buffer using efficient fragment culling
Presentation transcript:

Occlusion Query

Content Occlusion culling Collision detection (convex) Etc. Fall 20132

3 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 hidden  don’t render

Fall Modern Occlusion Culling GL_ARB_OCCLUSION_QUERY is the solution –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

Fall Overview Main usage: determine visibility of an object –Render major occluders first; perform an occlusion query for the bounding box of each detail object in the scene –Encapsulate each query in a “query object” that allow applications to issue many queries before asking for the result of any one

Fall API Query object –Contain one piece of state (integer result) –Active query API Summary –GenQueries (n, *ids); DeleteQueries (n, *ids) –IsQuery (id) –BeginQuery (target,id); EndQuery (target) Target: SAMPLES_PASSED –GetQueryObjectiv (id,QUERY_RESULT,*params) –Asynchronous query: QUERY_RESULT_AVAILABLE

Fall Example Asynchronous query; not “stop-and-wait”

Fall Occlusion Culling (ref)ref 1.Render every object's bounding mesh 2.For every object: a.Begin query b.Re-render the bounding mesh c.End query d.Retrieve occlusion query data. If the pixels visible are greater than zero, the object should be rendered. Otherwise, the object should be occluded from rendering.

Fall Demo Program First pass: render scene into depth buffer Second pass: render scene to query Depth test: GL_LEQUAL Get query results

Ex: Occlusion Culling Fall

Fall

Fall What good is it to know the number of samples visible Objects that are visible but cover only a very small number of pixels can be skipped at a minimal reduction of image quality. Knowing exactly how many pixels an object might cover may help the application decide which level-of-detail model should be used. If only a few pixels are visible, a low-detail model may be acceptable. "Depth peeling" techniques, such as order-independent transparency, need to know when to stop rendering more layers; it is difficult to determine a priori how many layers are needed. A boolean result allows applications to stop when more layers will not affect the image at all, but this will likely result in unacceptable performance. Instead, it makes more sense to stop rendering when the number of pixels in each layer falls below a given threshold. Occlusion queries can replace glReadPixels of the depth buffer to determine whether (for example) a light source is visible for the purposes of a lens flare effect or a halo to simulate glare. Pixel counts allow you to compute the percentage of the light source that is visible, and the brightness of these effects can be modulated accordingly.

Other Uses for Occlusion Queries –Approximate culling –LOD size estimation –Lens flare effects –Collision detection (next page) Fall

GPUCD – Convex objects Fall THE NINE CASES IN WHICH A RAY MAY INTERSECT TWO CONVEX OBJECTS, A AND B. collision

Two-Pass Algorithm First pass: –Render A to depth buffer (less-equal) –Change depth test to greater-than –Render B with occlusion query if nothing is visible, either B is fully in front of A, or no B [cases 9 & 3 & 1] Second pass: –switch roles of A & B [cases 4 & 2] All other cases: A & B intersect Fall

Ex: Two-Pass Algorithm Fall (a) Initial depth buffer (b) Render A to depth buffer; test B (c) Render B to depth buffer; test A

Fall

Fall

Result Fall