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

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

Optimized Stencil Shadow Volumes
Collision Detection CSCE /60 What is Collision Detection?  Given two geometric objects, determine if they overlap.  Typically, at least one of.
Ray Tracing CMSC 635. Basic idea How many intersections?  Pixels  ~10 3 to ~10 7  Rays per Pixel  1 to ~10  Primitives  ~10 to ~10 7  Every ray.
David Luebke5/11/2015 CS 551 / 645: Introductory Computer Graphics David Luebke
Occlusion Culling Fall 2003 Ref: GamasutraGamasutra.
CAP4730: Computational Structures in Computer Graphics Visible Surface Determination.
CHAPTER 12 Height Maps, Hidden Surface Removal, Clipping and Level of Detail Algorithms © 2008 Cengage Learning EMEA.
CSE 381 – Advanced Game Programming Scene Management
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,
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2007 Tamara Munzner Clipping II, Hidden Surfaces.
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.
Introduction General Data Structures - Arrays, Linked Lists - Stacks & Queues - Hash Tables & Binary Search Trees - Graphs Spatial Data Structures -Why.
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
Bounding Volume Hierarchies and Spatial Partitioning Kenneth E. Hoff III COMP-236 lecture Spring 2000.
Fall 2006 revised1 Frustum Culling in OpenGL Ref: MarkMoley.com.
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.
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.
David Luebke9/7/2015 CS 551 / 645: Introductory Computer Graphics David Luebke
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
Week 13 - Friday.  What did we talk about last time?  Ray/sphere intersection  Ray/box intersection  Slabs method  Line segment/box overlap test.
Real-Time Rendering SPEEDING UP RENDERING Lecture 04 Marina Gavrilova.
Visible-Surface Detection Jehee Lee Seoul National University.
Visibility Culling II: Beyond Cells & Portals David Luebke Computer Science Department University of Virginia
12/4/2001CS 638, Fall 2001 Today Managing large numbers of objects Some special cases.
Real-Time Rendering & Game Technology CS 446/651 David Luebke.
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.
CAP4730: Computational Structures in Computer Graphics
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.
Visibility II CS 446: Real-Time Rendering & Game Technology
Maths & Technologies for Games Spatial Partitioning 2
Maths & Technologies for Games Spatial Partitioning 1 CO3303 Week 8-9.
Honours Graphics 2008 Session 5. Today’s focus Rasterization Visibility determination Coarse / fine visibility determination.
DPL2/10/2016 CS 551/651: Final Review David Luebke
1 CSCE 441: Computer Graphics Hidden Surface Removal Jinxiang Chai.
Game Engine Design Quake Engine Presneted by Holmes 2002/12/2.
Shadows David Luebke University of Virginia. Shadows An important visual cue, traditionally hard to do in real-time rendering Outline: –Notation –Planar.
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.
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.
Bounding Volume Hierarchies and Spatial Partitioning
Bounding Volume Hierarchies and Spatial Partitioning
Today Visibility Overview Cell-to-Cell Cell-to-Region Eye-To-Region
CSCE 441: Computer Graphics Hidden Surface Removal
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
CS679 - Fall Copyright Univ. of Wisconsin
Presentation transcript:

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

Real-Time Rendering 2 David Luebke Happy Valentines Day!

Real-Time Rendering 3 David Luebke Bittersweets: Dejected sayings I MISS MY EX PEAKED AT 17 MAIL ORDER TABLE FOR 1 I CRY ON Q U C MY BLOG? REJECT PILE PILLOW HUGGIN ASYLUM BOUND DIGNITY FREE PROG FAN STATIC CLING WE HAD PLANS XANADU 2NITE SETTLE 4LESS NOT AGAIN

Real-Time Rendering 4 David Luebke Bittersweets: Dysfunctional sayings RUMORS TRUE PRENUP OKAY? HE CAN LISTEN GAME ON TV CALL A 900# P.S. I LUV ME DO MY DISHES UWATCH CMT PAROLE IS UP! BE MY YOKO U+ME=GRIEF I WANT HALF RETURN 2 PIT NOT MY MOMMY BE MY PRISON C THAT DOOR?

Real-Time Rendering 5 David Luebke Demo Time: Ken Arthur

Real-Time Rendering 6 David Luebke Homework The pitch, round 2 –Many ideas way too hard Art assets (Much) character animation Elaborate AI/gameplay –Some of my favorites so far: Gallery Mariokart Pirates (but just the ships) Combat billiards Orb (a la marble madness) Waverace –Too hard: Total War (Full-blown) RPG Ninjas UVA v. VaTech –Yes to: Terrain LOD, mocap data, NPR, Shadows –No to: Combat animations, AI, big worlds –Out-of-the-box ideas?

Real-Time Rendering 7 David Luebke Project preview Next 48 hours: –Pitch a few more ideas on forum –Submit “signup sheet” by List 3 project ideas you’d be happy to work on I assign groups on Thursday based roughly on interest overlap –Note: I assign groups, not project ideas! –Assignment 3: Groups build a basic engine Groups propose their final idea –Later may reorganize groups, allow 3 rd -party engines

Real-Time Rendering 8 David Luebke 5 Steps to Efficient Rendering Step 1: reduce #vertices/triangle Step 2: reduce overhead of each vertex Step 3: recognize the existence of the vertex cache Step 4: display lists (deprecated re: performance) Step 5: learn about the hardware Meta-step 0: profile and analyze code

Real-Time Rendering 9 David Luebke Other things you should know Most interesting stuff in OpenGL isn’t in red book –Extension registry Extensions you should know: –ARB_multitexture –EXT_framebuffer_object –ARB_occlusion_query –ARB_point_sprite –ARB_texture_rectangle –ARB_draw_buffers –ARB_texture_float (_framebuffer_float, _half_float_pixel, etc) –ARB_depth_texture –ARB_vertex_buffer_object (_pixel_buffer_object)

Real-Time Rendering 10 David Luebke Other things you should know Most interesting stuff in OpenGL isn’t in red book –Extension registry –Developer sites Find demos, tools, tutorials, presentations, white papers

Real-Time Rendering 11 David Luebke Visibility Calculations Motivation –Avoid rendering redundant geometry Complements LOD, potentially even more powerful –Basic idea: don’t render what can’t be seen Off-screen: view-frustum culling Occluded by other objects: occlusion culling

Real-Time Rendering 12 David Luebke Motivation The obvious question: why bother? –Off-screen geometry: solved by clipping –Occluded geometry: solved by Z-buffer The (obvious) answer: efficiency –Clipping and Z-buffering take time linear to the number of primitives

Real-Time Rendering 13 David Luebke The Goal 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 14 David Luebke View-Frustum Culling An old idea (Clark 76): –Organize primitives into clumps –Before rendering the primitives in a clump, test a 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, add to PVS and render normally

Real-Time Rendering 15 David Luebke Efficient View-Frustum Culling How big should the clumps be? –Choose minimum size so: cost testing bounding volume << cost clipping primitives –Choose minimum size so primitives can be rendered efficiently At least 500 triangles/clump on today’s hardware –Organize clumps into a hierarchy of bounding volumes for more efficient testing If a clump is entirely outside or entirely inside view frustum, no need to test its children

Real-Time Rendering 16 David Luebke Efficient View-Frustum Culling What shape should bounding volumes be? –Spheres and axis-aligned bounding boxes: simple to calculate, cheap to test – Oriented bounding boxes converge asymptotically faster in theory –Lots of other volumes have been proposed Capsules, ellipsoids, k-DOPs –…but most use spheres or AABBs.

Real-Time Rendering 17 David Luebke Cells & Portals Goal: walk through 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 18 David Luebke Cells & Portals An example:

Real-Time Rendering 19 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 20 David Luebke Cells & Portals A D H F CB E G H BCDFG EA

Real-Time Rendering 21 David Luebke Cells & Portals A D H F CB E G H BCDFG EA

Real-Time Rendering 22 David Luebke Cells & Portals A D H F CB E G H BCDFG EA

Real-Time Rendering 23 David Luebke Cells & Portals A D H F CB E G H BCDFG EA

Real-Time Rendering 24 David Luebke Cells & Portals A D H F CB E G H BCDFG EA

Real-Time Rendering 25 David Luebke Cells & Portals A D H F CB E G H BCDFG EA ? ?

Real-Time Rendering 26 David Luebke Cells & Portals A D H F CB E G H BCDFG EA X X

Real-Time Rendering 27 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 CB E G A D H E

Real-Time Rendering 28 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 CB E G A D CB E G

Real-Time Rendering 29 David Luebke Cells and Portals Questions: – 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 30 David Luebke Cells and Portals: History Airey (1990): view-independent only –Portal-portal visibility determined by ray-casting Non-conservative portal-portal test resulted in occasional errors in PVS –Slow preprocess –Order-of-magnitude speedups

Real-Time Rendering 31 David Luebke Cells and Portals: History Teller (1993): view-independent + view-dependent –Portal-portal visibility calculated by line stabbing using linear program Cell-cell visibility stored in stab trees View-dependent eye-portal visibility stage further refines PVS at run time –Slow preprocess –Elegant, exact scheme

Real-Time Rendering 32 David Luebke Cells and Portals: History Luebke & Georges (1995): view-dependent only –Eye-portal visibility determined by intersecting portal cull boxes –No preprocess (integrate w/ modeling) –Quick, simple hack –Now-archaic public-domain library: pfPortals

Real-Time Rendering 33 David Luebke pfPortals 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 34 David Luebke pfPortals 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