Visibility Culling David Luebke Computer Science Department University of Virginia

Slides:



Advertisements
Similar presentations
Visible-Surface Detection(identification)
Advertisements

Christian Lauterbach COMP 770, 2/16/2009. Overview  Acceleration structures  Spatial hierarchies  Object hierarchies  Interactive Ray Tracing techniques.
Week 7 - Monday.  What did we talk about last time?  Specular shading  Aliasing and antialiasing.
N-Buffers for efficient depth map query Xavier Décoret Artis GRAVIR/IMAG INRIA.
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 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.
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.
Shadow Silhouette Maps Pradeep Sen, Mike Cammarano, Pat Hanrahan Stanford University.
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,
DDDDRRaw: A Prototype Toolkit for Distributed Real-Time Rendering on Commodity Clusters Thu D. Nguyen and Christopher Peery Department of Computer Science.
Image-Based Techniques Hierarchical Image Caching Michael Chung.
1 From-Point Occlusion Culling From-Point Occlusion Culling Chapter 23.
Hidden Surface Removal
1 Occlusion Culling ©Yiorgos Chrysanthou, , Anthony Steed, 2004.
Roger A. Crawfis CIS 781 The Ohio State University
Afrigraph 2004 Massive model visualization Tutorial A: Part I Rasterization Based Approaches Andreas Dietrich Computer Graphics Group, Saarland University.
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”
Visibility Culling David Luebke Computer Science Department University of Virginia
C O M P U T E R G R A P H I C S Guoying Zhao 1 / 14 C O M P U T E R G R A P H I C S Guoying Zhao 1 / 14 Going-through.
Week 2 - Friday.  What did we talk about last time?  Graphics rendering pipeline  Geometry Stage.
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.
Visibility Culling II: Beyond Cells & Portals David Luebke Computer Science Department University of Virginia
2 COEN Computer Graphics I Evening’s Goals n Discuss application bottleneck determination n Discuss various optimizations for making programs execute.
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 Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico.
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.
04/23/03© 2003 University of Wisconsin Where We’ve Been Photo-realistic rendering –Accurate modeling and rendering of light transport and surface reflectance.
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.
Graphics Graphics Korea University cgvr.korea.ac.kr 1 7. Speed-up Techniques Presented by SooKyun Kim.
Graphics Interface 2009 The-Kiet Lu Kok-Lim Low Jianmin Zheng 1.
Visibility II CS 446: Real-Time Rendering & Game Technology
LOD Unresolved Problems The LOD algorithms discussed previously do not perform well with large amounts of visible objects Consider a large number of tress.
Computer Graphics I, Fall 2010 Implementation II.
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
Occlusion Culling David Luebke University of Virginia.
CS 445: Introduction to Computer Graphics David Luebke University of Virginia Visibility Calculations and Occlusion Culling.
CHC ++: Coherent Hierarchical Culling Revisited Oliver Mattausch, Jiří Bittner, Michael Wimmer Institute of Computer Graphics and Algorithms Vienna University.
7/17/98 HZ Hierarchical Occlusion Maps stolen by Dave Luebke from the Ph.D. Defense presentation of: Hansong Zhang Department of Computer Science UNC-Chapel.
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.
Computer Graphics Implementation II
CSCE 441: Computer Graphics Hidden Surface Removal
Implementation II Ed Angel Professor Emeritus of Computer Science
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
Introduction to Computer Graphics with WebGL
Implementation II Ed Angel Professor Emeritus of Computer Science
Presentation transcript:

Visibility Culling David Luebke Computer Science Department University of Virginia

D2 Recap: General Occlusion Culling When cells and portals don’t work…When cells and portals don’t work… –Trees in a forest –A crowded train station Need general occlusion culling algorithms:Need general occlusion culling algorithms: –Aggregate occlusion –Dynamic scenes –Non-polygonal scenes

D3 Recap: General Occlusion Culling I’ll discuss two algorithms:I’ll discuss two algorithms: –Hierarchical Z-Buffer Ned Greene, SIGGRAPH 93 Ned Greene, SIGGRAPH 93 –Hierarchical Occlusion Maps Hansong Zhang, SIGGRAPH 97 Hansong Zhang, SIGGRAPH 97

D4 Recap: Hierarchical Z-Buffer Replace Z-buffer with a Z-pyramidReplace Z-buffer with a Z-pyramid –Lowest level: full-resolution Z-buffer –Higher levels: each pixel represents the maximum depth of the four pixels “underneath” it Basic idea: hierarchical rasterization of the polygon, with early termination where polygon is occludedBasic idea: hierarchical rasterization of the polygon, with early termination where polygon is occluded

D5 Hierarchical Z-Buffer Idea: test polygon against highest level firstIdea: 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

D6 Hierarchical Z-Buffer Z-pyramid exploits image-space coherence :Z-pyramid exploits image-space coherence : –Polygon occluded in a pixel is probably occluded in nearby pixels HZB also exploits object-space coherenceHZB also exploits object-space coherence –Polygons near an occluded polygon are probably occluded

D7 Hierarchical Z-Buffer Exploiting object-space coherence: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, “render” the faces of its cube (i.e., query the Z-pyramid) –If cube faces are occluded, ignore the entire node

D8 Hierarchical Z-Buffer HZB can exploit temporal coherenceHZB 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 frameSo start each frame by rendering octree nodes visible last frame

D9 Hierarchical Z-Buffer: Discussion HZB needs hardware support to be really competitiveHZB needs hardware support to be really competitive To date, hardware vendors haven’t bought in:To date, hardware vendors haven’t bought in: –Z-pyramid (and hierarchies in general) unfriendly to hardware –Unpredictable Z-query times generate bubbles in rendering pipe But there is a promising trend…But there is a promising trend…

D10 Hierarchical Z-Buffer Hardware beginning to support Z-query operationHardware beginning to support Z-query operation –Allows systems to exploit: Object-space coherence (bounding boxes) Object-space coherence (bounding boxes) Temporal coherence (last-rendered list) Temporal coherence (last-rendered list) –Systems I’m aware of: HP Visualize- fx graphics HP Visualize- fx graphics SGI Visual Workstation products SGI Visual Workstation products –An aside: applies to cell-portal culling!

D11 Hierarchical Occlusion Maps A more hardware-friendly general occlusion culling algorithmA more hardware-friendly general occlusion culling algorithm Two major differences from HZB:Two major differences from HZB: –Separates occluders from occludees –Decouples occlusion test into an depth test and a overlap test

D12 Hierarchical Occlusion Maps Occluders versus occludees:Occluders versus occludees: Blue parts: occluders Red parts: occludees

D13 Hierarchical Occlusion Maps Depth versus overlap:Depth versus overlap: View Point Z X Y Depth + Overlap = Occlusion Depth + Overlap = Occlusion

D14 Hierarchical Occlusion Maps Representation of projection for overlap test: occlusion mapRepresentation of projection for overlap test: occlusion map –Corresponds to a screen subdivision –Records average opacity per partition Generate by rendering occludersGenerate by rendering occluders –Record pixel opacities (i.e., coverage)

D15 Rendered Image Occlusion Map Occlusion Maps

D16 Occlusion Map Pyramid 64 x 6432 x 3216 x 16

D17 Occlusion Map Pyramid

D18 Occlusion Map Pyramid Analyzing cumulative projection:Analyzing cumulative projection: –A hierarchical occlusion map (HOM) –Generate by recursive averaging (once per frame) –Records average opacities for blocks of multiple pixels, representing occlusion at multiple resolutions –Construction can be accelerated by texture hardware

D19 Overlap Tests Query: is projection of occludee inside cumulative projection of occluders?Query: is projection of occludee inside cumulative projection of occluders? –Cumulative projection: occlusion pyramid –Ocludee projection: expensive in general Overestimate ocludee with 3-D bounding box Overestimate ocludee with 3-D bounding box Overestimate projection of 3-D bounding box with 2-D bounding rectangle in screen-space Overestimate projection of 3-D bounding box with 2-D bounding rectangle in screen-space

D20 Overlap Tests Hierarchical structure enables some optimizations:Hierarchical structure enables some optimizations: –Predictive rejection Terminate test when it must fail later Terminate test when it must fail later –Conservative rejection The transparency threshold The transparency threshold –Aggressive Approximate Culling Ignore objects barely visible through holes Ignore objects barely visible through holes The opacity threshold The opacity threshold

D21 Aggressive Approximate Culling

D22 Hierarchical Occlusion Maps Not discussed here:Not discussed here: –Depth test Depth estimation buffer Depth estimation buffer Modified Z-buffer Modified Z-buffer –Selecting occluders For more details, see attached excerpt from Hansong Zhang’s dissertationFor more details, see attached excerpt from Hansong Zhang’s dissertation

D23 HOM: Discussion Provides a robust, general, hardware- friendly occlusion culling algorithmProvides a robust, general, hardware- friendly occlusion culling algorithm –Supports dynamic scenes –Supports non-polygonal geometry –Not many hardware assumptions

D24 HOM: Discussion Efficient coding, careful tuning a mustEfficient coding, careful tuning a must Fairly high per-frame overheadFairly high per-frame overhead –Needs high depth complexity, good occluder selection to be worthwhile –UNC’s MMR system:

D25 Visibility Culling: Discussion When is visibility culling worthwhile? When is visibility culling worthwhile? –When scene has high depth complexity Examples: architectural walkthroughs, complex CAD assemblies, dense forest Examples: architectural walkthroughs, complex CAD assemblies, dense forest Non-examples: terrain, single highly-tesselated object (e.g., a radiositized room) Non-examples: terrain, single highly-tesselated object (e.g., a radiositized room)

D26 Visibility Culling: Discussion How does visibility culling compare to: How does visibility culling compare to: –Level-of-detail: Reduces geometry processing Reduces geometry processing Helps transform-bound apps Helps transform-bound apps –Visibility culling: Reduces geometry and pixel processing Reduces geometry and pixel processing Helps transform- and fill rate-bound apps Helps transform- and fill rate-bound apps –Texture / Image representations: Reduces geometry and pixel processing Reduces geometry and pixel processing Incurs texture/image processing costs Incurs texture/image processing costs

D27 Visibility Culling: Discussion How does visibility culling interact with level of detail? How does visibility culling interact with level of detail? –Fairly seamless integration; generally a win –One issue: visibility of simplified model may differ from original model; requires some care –LODs can speed up occluder selection and rendering

D28 Visibility Culling: Discussion How does visibility culling interact with texture and image-based representations? How does visibility culling interact with texture and image-based representations? –Texture/image reps generally replace far-field geometry Involves an implicit occlusion culling step Involves an implicit occlusion culling step Reduces scene depth complexity, decreasing the utility of visibility culling Reduces scene depth complexity, decreasing the utility of visibility culling If near-field geometry still includes complex heavily- occlusive assemblies, still a win If near-field geometry still includes complex heavily- occlusive assemblies, still a win

D29 Visibility Culling: Discussion How much culling effort is appropriate? How much culling effort is appropriate? –Cells and portals: relatively cheap, with large potential speedups –Hierarchical occlusion maps: relatively costly, carefully weigh potential gains –Multiple processors allow much more aggressive culling calculation Pipelining culling calculations, Performer-style, allows cull time = render time Pipelining culling calculations, Performer-style, allows cull time = render time Tradeoff: one frame increased latency Tradeoff: one frame increased latency

D30 Summary The basic, very powerful idea:The basic, very powerful idea: –Rapidly compute a potentially visible set –Let hardware handle the rest For many scenes, visibility culling is a simple way to get huge speedupsFor many scenes, visibility culling is a simple way to get huge speedups –View-frustum culling always a must –For scenes with high depth complexity, occlusion culling can be a big win

D31 Summary Architectural models: visibility is practically a solved problemArchitectural models: visibility is practically a solved problem –Cells and portals work well Cull-box portal culling: simple, fast Cull-box portal culling: simple, fast Line-stabbing: elegant, powerful Line-stabbing: elegant, powerful

D32 Summary Occlusion culling of general models: still a largely open problemOcclusion culling of general models: still a largely open problem –Important issues: Dynamic scenes Dynamic scenes Aggregate occlusion effects Aggregate occlusion effects

D33 Summary General occlusion culling algorithms:General occlusion culling algorithms: –Hierarchical Z-buffer: A simple, truly elegant algorithm A simple, truly elegant algorithm But doesn’t seem amenable to hardware But doesn’t seem amenable to hardware –Hierarchical occlusion maps: More complicated, difficult to code & tune More complicated, difficult to code & tune Better suited to current hardware Better suited to current hardware Lends itself well to aggressive culling Lends itself well to aggressive culling Fairly high overhead, only worthwhile with high depth complexity Fairly high overhead, only worthwhile with high depth complexity –Promising trend in hardware