Visibility Culling Markus Hadwiger & Andreas Varga.

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.
Collisions and Intersections When objects move, test for collision. When projecting surfaces, check for intersections. (Many slides adapted from Amitabh.

Computer graphics & visualization Collisions. computer graphics & visualization Simulation and Animation – SS07 Jens Krüger – Computer Graphics and Visualization.
AreaPortal Visibility By Filami. Objectives Practice the techniques of visibility determination using Area Portals; Develop an experimental application.
03/12/02 (c) 2002 University of Wisconsin, CS559 Last Time Some Visibility (Hidden Surface Removal) algorithms –Painter’s Draw in some order Things drawn.
David Luebke5/11/2015 CS 551 / 645: Introductory Computer Graphics David Luebke
CAP4730: Computational Structures in Computer Graphics Visible Surface Determination.
Visibility in Computer Graphics Toni Sellarès Unversitat de Girona
CSE 381 – Advanced Game Programming Scene Management
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,
1 Dr. Scott Schaefer Hidden Surfaces. 2/62 Hidden Surfaces.
Tomas Mőller © 2000 Speeding up your game The scene graph Culling techniques Level-of-detail rendering (LODs) Collision detection Resources and pointers.
Introduction General Data Structures - Arrays, Linked Lists - Stacks & Queues - Hash Tables & Binary Search Trees - Graphs Spatial Data Structures -Why.
Non-Invasive Interactive Visualization of Architectural Environments Christopher NiederauerU.C. Santa Barbara Mike HoustonStanford University Maneesh AgrawalaMicrosoft.
Advanced Data Structures for Games and Graphics Lecture 4
1 Clipping and Hidden Surfaces CS-184: Computer Graphics Prof. James O’Brien.
1 Advanced Scene Management System. 2 A tree-based or graph-based representation is good for 3D data management A tree-based or graph-based representation.
Spatial Data Structure: Quadtree, Octree,and BSP tree Mengxia Zhu Fall 2007.
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.
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.
University of Texas at Austin CS 378 – Game Technology Don Fussell CS 378: Computer Game Technology Spatial Partitioning, Visibility and Culling Spring.
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)
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
Computer Graphics 2 Lecture 8: Visibility Benjamin Mora 1 University of Wales Swansea Pr. Min Chen Dr. Benjamin Mora.
The BSP-tree from Prof. Seth MIT.. Motivation for BSP Trees: The Visibility Problem We have a set of objects (either 2d or 3d) in space. We have.
Real-Time Rendering SPEEDING UP RENDERING Lecture 04 Marina Gavrilova.
1 Advanced Scene Management. 2 This is a game-type-oriented issue Bounding Volume Hierarchies (BVHs) Binary space partition trees (BSP Trees) “Quake”
CS-378: Game Technology Lecture #10: Spatial Data Structures Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran.
PRESENTED BY – GAURANGI TILAK SHASHANK AGARWAL Collision Detection.
Collaborative Visual Computing Lab Department of Computer Science University of Cape Town Graphics Topics in VR By Shaun Nirenstein.
03/14/02 (c) 2002 University of Wisconsin, CS559 Last Time Some more visibility (Hidden Surface Removal) algorithms –A-buffer –Scanline –Depth sorting.
2 COEN Computer Graphics I Evening’s Goals n Discuss application bottleneck determination n Discuss various optimizations for making programs execute.
CS-378: Game Technology Lecture #2.2: Clipping and Hidden Surfaces Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney,
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.
3/23/04© University of Wisconsin, CS559 Spring 2004 Last Time Antialiasing –Area-weighted sampling Visibility –Painters algorithm –Depth buffer (Z-buffer)
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.
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.
Maths & Technologies for Games Spatial Partitioning 2
Maths & Technologies for Games Spatial Partitioning 1 CO3303 Week 8-9.
1 CSCE 441: Computer Graphics Hidden Surface Removal Jinxiang Chai.
Game Engine Design Quake Engine Presneted by Holmes 2002/12/2.
Computer Graphics Inf4/MSc 1 Computer Graphics Lecture 5 Hidden Surface Removal and Rasterization Taku Komura.
1 Advanced Scene Management. 2 This is a game-type-oriented issue Bounding Volume Hierarchies (BVHs) Binary space partition trees (BSP Trees) “Quake”
CS552: Computer Graphics Lecture 28: Solid Modeling.
Visibility-Driven View Cell Construction Oliver Mattausch, Jiří Bittner, Michael Wimmer Institute of Computer Graphics and Algorithms Vienna University.

Bounding Volume Hierarchies and Spatial Partitioning
Bounding Volume Hierarchies and Spatial Partitioning
© University of Wisconsin, CS559 Fall 2004
Hidden Surfaces Dr. Scott Schaefer.
Today Visibility Overview Cell-to-Cell Cell-to-Region Eye-To-Region
CSCE 441: Computer Graphics Hidden Surface Removal
CS679 - Fall Copyright Univ. of Wisconsin
Presentation transcript:

Visibility Culling Markus Hadwiger & Andreas Varga

Basics Hierarchical Subdivision –Hierarchical Bounding Boxes –Octrees –K-D Trees ( K-Dimensional Space) –BSP Trees ( Binary Space Partition ) Potentially Visible Sets (PVS)

Hierarchical Bounding Box (HS) Construct a bounding box for each object Merge nearby bounding box into bigger ones Not very structured and systematic Perform well for certain viewpoint Shortcomings: –Highly dependent on the given scene (worse: on the actual viewpoint) –Unpredictable not very useful !

Hierarchical Bounding Box Example (HS) WORLD ROLLERCOASTER CAR #2CAR #1 GUY_BAD GUNGUY_BAD

Octrees (HS) Each node of and octree has form one to eight children if it is an internal node; otherwise it is a leaf node Culling against the viewing frustum Shortcomings of regular subdivision –Efficiently problem (inflexible) –Depend on the location of each polygon The two dimensional version of an octree is called quadtree

Octrees Example (HS)

K-D Trees 2/2 (HS) Hierarchically subdivide n-dimensional space A binary tree –partitioning space into two halfspaces at each level –two equal-sized partitions is not necessary (Octrees) Always done axial A separating hyperplane can depend on actual data Balance of binary tree –One halfspace contains the same number of objects as the other halfspace

K-D Trees Example 1/2 (HS)

K-D Trees Example 2/2 (HS)

BSP Trees 6 (HS) Generalization of k-D trees –Space is subdivided along arbitrarily oriented hyperlpanes –Subdivision of space into two halfspace at each step Produces a binary tree Internal node corresponds to the partitioning hyperplane Leaf nodes are empty halfspaces Exact visibility determination for arbitrary viewpoint –For entirely static polygonal scenes Can be precalculated once and traversal at run time with arbitrary viewpoint

BSP Trees Example 1 (HS)

BSP Trees Example 2 (HS) a 5 6 4b front 1 2

BSP Trees Example 3 (HS) a 5 6 4b 1 32 frontback

BSP Trees Example 4 (HS) a 5 6 4b a frontback front 4b back

BSP Trees Example 5 (HS) a 4b a 5 6 4b frontback frontbackfront

BSP Trees Example 6 (HS) V1 V a 4b 6 5 frontback frontbackfront The painting order from V1: 3, 5, 1, 4b, 2, 6, 4a The painting order from V2: 3, 5, 1, 4b, 2, 4a, 6 We got correct picture of who is behind whom no matter where we were looking from.

BSP Trees Example 6 (HS)

Cell-Portals Assume the world can be broken into cells –Simple shapes –Rooms in a building, for instance Define portals to be the transparent boundaries between cells –Doorways between rooms, windows, etc In a world like this, can determine exactly which parts of which rooms are visible –Then render visible rooms plus contents

Cell-Portals Example AB CD EF AB CD EF - Node are cells, edges are portals - K-D trees and BSP trees are used to generate the cell structure and find neighbors and portals - Portals can be one way (directed edges) - Graph is normally stored in adjacency list format - Each cell stores the edges (portals) out of it

Cell and Portal Visibility Keep track of which cell the viewer is in Somehow walk the graph to enumerate all the visible regions –Can be done as a preprocess to identify the potentially visible set (PVS) for each cell Cell-to-region visibility, or cell-to-object visibility –Can be done at run-time for a more accurate visible set Start at the known viewer location Eye-to-region or Eye-to-cell visibility –Trade-off is between time spent rendering more than is necessary vs. time spent computing a smaller set Depends on the environment, such as the size of cells, density of objects, …

Potentially Visible Sets (PVS) PVS: The set of cells/regions/objects/polygons that can be seen from a particular cell –Generally, choose to identify objects that can be seen –Trade-off is memory consumption vs. accurate visibility Computed as a pre-process –Have to have a strategy to manage dynamic objects Used in various ways: –As the only visibility computation - render everything in the PVS for the viewer’s current cell –As a first step - identify regions that are of interest for more accurate run-time algorithms

Cell-to-Cell PVS Cell A is in cell B ’ s PVS if there exist a stabbing line that originates on a portal of B and reaches a portal of A –A stabbing line is a line segment intersecting only portals –Neighbor cells are trivially in the PVS I J H G A C BE F D PVS for I contains: B, C, E, F, H, J

Finding Stabbing Lines In 2D, have to find a line that separates the left edges of the portals from the right edges In 3D, more complex because portals are now a sequence of arbitrarily aligned polygons –Put rectangular bounding boxes around each portal and stab those L L LLR R R R

Stab Trees A stab tree indicates: –The PVS for a cell –The portal sequences to get from one to the other Used in further visibility processing –Restricts number of cells/portals that must be looked at A C DE A/C C/D 1 C/D 2 C/E AB CD EF D F D/F

Run-Time Visibility PVS approaches are entirely pre-processing –At run time, just render PVS Better results can be obtained with a little run-time processing –Sometimes guided by PVS –It appears that most games don’t bother, the trade-off favors pre-processed visibility and over-rendering At run time the viewer’s location is known, hence Eye-to-Region visibility

Eye-to-Cell Recall that finding stabbing lines involved finding a line that passed through all the portals The viewer adds some constraints: –The stabbing line must pass through the eye –It must be inside the view frustum The resulting problem is still reasonably fast to solve –Results in knowledge of which cells are visible from the eye –Use the stab tree from the PVS computation to avoid wasting effort –Further optimization is to keep reducing the view frustum as it passes through each portal, which leads us to…

Eye-to-Region Visibility Define a procedure : –Takes a view frustum and a cell Viewer not necessarily in the cell –Draws the contents of the cell that are in the frustum –For each portal out of the cell, clips the frustum to that portal and recurs with the new frustum and the cell beyond the portal Make sure not to go to the cell you entered Start in the cell containing the viewer, with the full viewing frustum Stop when no more portals intersect the view frustum

Eye-to-Region Example View

Eye-to-Region Example View

Eye-to-Region Example View

Eye-to-Region Example View

Eye-to-Region Example View

Eye-to-Region Example View

Eye-to-Region Example View

Non-Invasive Interactive Visualization of Architectural Environments Christopher NiederauerU.C. Santa Barbara Mike HoustonStanford University Maneesh AgrawalaMicrosoft Research Greg HumphreysUniversity of Virginia

Problem Environments of video game are vast and tend to be densely occluded. Most 3D model viewing application lack the ability to simultaneously display the interior spaces and the external structure of the environment.

Motivation Arcball style manipulator Walkthrough Can ’ t see overall interior/exterior structure! ArcBall [Shoemake 1992][Teller 1992]

Motivation The occlusions make it impossible to see all the action at once! Quake III [Id Software c. 2002]

The Idea Exploded view –just below the ceilings Non-Invasive [Mohr 2001] –without modification –use Chromium [Humphreys et al. 2002] Overall structure is visible!

How It ’ s Done Example Architecture: Soda Hall –Geometric Analysis (once) –Rendering (every frame) OpenGL Stream Geometric Analysis Gather Data Find Splits Rendering … Floor Composite

Gather Architectural Data Intercept the OpenGL stream –Find downward facing polygons Requires up-vector up 1 23 –Compute the height of downward facing polygon 1 height = v1 ‧ upVector polygon normal = (v2-v1) x (v3-v2)

446 Gather Architectural Data Create Histogram Height Ceiling Area Geometric AnalysisRendering OpenGL Stream … Floor Composite Soda Hall Side Profile Find Splits Gather Data

Find Splits Find Splitting Heights Geometric AnalysisRendering Gather Data OpenGL Stream … Floor Composite

Offset Ceiling Heights

Geometric Analysis Find Splits Geometric Analysis Rendering Gather Data OpenGL Stream … Floor Composite Find Downward Facing Polygons Up Vector Find Split Heights Player Height NumSplits Table Mapping Height to Surface Area List of Split Height

Rendering Multiple Playback (Once per Floor) –Viewpoint Control –Clipping Planes –Translate along Up Vector Geometric AnalysisRendering Gather Data Find Splits OpenGL Stream … Floor Composite

Rendering Multiple Playback Set Viewpoint Clip Plans & Translation Viewpoint NumSplits Multipass Composite Set Viewpoint Clip Plans & Translation … NumSplits Passes of Original OpenGL NumSplits Passes of Modified OpenGL Separation Distance Exploded view visualization Geometric Analysis List of Split Heights Original Application OpenGL

Cluster Speedup Composite Floor 1 Floor 2Floor 3 Complete Model 800 MHz Pentium III Xeon processor NVIDIA GeForce4 graphics accelerator

Soda Hall Trackball Walkthrough

Results with Soda Hall (Single Floor)

Quake III: Arena Trackball Walkthrough

Results with Quake III: Arena (Single Floor) Item

Video

Transparent Back-Faces

Future Directions Make fully automated: –Semantic inputs Up vector Number of stories to split into

Future Directions [Salomon et al, 2003]

Future Directions (Hand Designed Mock-up)

Summary and Conclusions Can improve viewer comprehension

Resource Visibility Culling Stephen Chenney Non-Invasive Interactive Visualization of Dynamic Architectural Environments Chromium Homepage