Visibility Queries Using Graphics Hardware Presented by Jinzhu Gao.

Slides:



Advertisements
Similar presentations
Exploration of advanced lighting and shading techniques
Advertisements

Optimized Stencil Shadow Volumes
RealityEngine Graphics Kurt Akeley Silicon Graphics Computer Systems.
CSL 859: Advanced Computer Graphics Dept of Computer Sc. & Engg. IIT Delhi.
Computer graphics & visualization Global Illumination Effects.
Interactive Rendering using the Render Cache Bruce Walter, George Drettakis iMAGIS*-GRAVIR/IMAG-INRIA Steven Parker University of Utah *iMAGIS is a joint.
Render Cache John Tran CS851 - Interactive Ray Tracing February 5, 2003.
Week 10 - Monday.  What did we talk about last time?  Global illumination  Shadows  Projection shadows  Soft shadows.
Graphics Graphics Korea University cgvr.korea.ac.kr 1 Hidden Surface Removal 고려대학교 컴퓨터 그래픽스 연구실.
Part I: Basics of Computer Graphics
Visibility Culling. Back face culling View-frustrum culling Detail culling Occlusion culling.
Ray Tracing & Radiosity Dr. Amy H. Zhang. Outline  Ray tracing  Radiosity.
1 Dr. Scott Schaefer Shadows. 2/40 Shadows Shadows provide clues about depth Make scenes appear more realistic.
I3D Fast Non-Linear Projections using Graphics Hardware Jean-Dominique Gascuel, Nicolas Holzschuch, Gabriel Fournier, Bernard Péroche I3D 2008.
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.
CS 4731: Computer Graphics Lecture 18: Hidden Surface Removal Emmanuel Agu.
Control Flow Virtualization for General-Purpose Computation on Graphics Hardware Ghulam Lashari Ondrej Lhotak University of Waterloo.
Collision Detection on the GPU Mike Donovan CIS 665 Summer 2009.
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.
1 Dynamic Shadows and Lighting for Walkthrus of Large Models Brandon Lloyd COMP 258 December 2002.
1 CSCE 441: Computer Graphics Hidden Surface Removal (Cont.) Jinxiang Chai.
Z-Buffer Optimizations Patrick Cozzi Analytical Graphics, Inc.
Z-Buffer Optimizations Patrick Cozzi Analytical Graphics, Inc.
1 7M836 Animation & Rendering Global illumination, ray tracing Arjan Kok
Some Things Jeremy Sugerman 22 February Jeremy Sugerman, FLASHG 22 February 2005 Topics Quick GPU Topics Conditional Execution GPU Ray Tracing.
Paper by Alexander Keller
Vertices and Fragments III Mohan Sridharan Based on slides created by Edward Angel 1 CS4395: Computer Graphics.
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Geometric Computations on GPU: Proximity Queries Avneesh Sud &Dinesh Manocha.
Computer Graphics Shadows
Hidden Surface Removal
Erdem Alpay Ala Nawaiseh. Why Shadows? Real world has shadows More control of the game’s feel  dramatic effects  spooky effects Without shadows the.
Computer Graphics Mirror and Shadows
Shadow Algorithms Ikrima Elhassan.
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.
CSL 859: Advanced Computer Graphics Dept of Computer Sc. & Engg. IIT Delhi.
Cg Programming Mapping Computational Concepts to GPUs.
CS 450: COMPUTER GRAPHICS REVIEW: INTRODUCTION TO COMPUTER GRAPHICS – PART 2 SPRING 2015 DR. MICHAEL J. REALE.
Matrices from HELL Paul Taylor Basic Required Matrices PROJECTION WORLD VIEW.
Computer Graphics 2 Lecture 8: Visibility Benjamin Mora 1 University of Wales Swansea Pr. Min Chen Dr. Benjamin Mora.
Visible-Surface Detection Jehee Lee Seoul National University.
Ray Tracing Jian Huang, CS 594, Fall, 2002 This set of slides are used at Ohio State by Prof. Roger Crawfis.
Image-based Rendering. © 2002 James K. Hahn2 Image-based Rendering Usually based on 2-D imagesUsually based on 2-D images Pre-calculationPre-calculation.
Occlusion Query. Content Occlusion culling Collision detection (convex) Etc. Fall
Shadows. Shadows is important in scenes, consolidating spatial relationships “Geometric shadows”: the shape of an area in shadow Early days, just pasted.
1 Real-time visualization of large detailed volumes on GPU Cyril Crassin, Fabrice Neyret, Sylvain Lefebvre INRIA Rhône-Alpes / Grenoble Universities Interactive.
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.
Binary Space Partitioning Trees Ray Casting Depth Buffering
Hidden Surface Removal
Implementation II.
Hierarchical Penumbra Casting Samuli Laine Timo Aila Helsinki University of Technology Hybrid Graphics, Ltd.
Global Illumination. Local Illumination  the GPU pipeline is designed for local illumination  only the surface data at the visible point is needed to.
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.
Graphics Interface 2009 The-Kiet Lu Kok-Lim Low Jianmin Zheng 1.
Computer Graphics I, Fall 2010 Implementation II.
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.
09/23/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Reflections Shadows Part 1 Stage 1 is in.
CHC ++: Coherent Hierarchical Culling Revisited Oliver Mattausch, Jiří Bittner, Michael Wimmer Institute of Computer Graphics and Algorithms Vienna University.
SHADOW CASTER CULLING FOR EFFICIENT SHADOW MAPPING JIŘÍ BITTNER 1 OLIVER MATTAUSCH 2 ARI SILVENNOINEN 3 MICHAEL WIMMER 2 1 CZECH TECHNICAL UNIVERSITY IN.
Real-Time ray casting for virtual reality
Computer Graphics Implementation II
Real-Time Soft Shadows with Adaptive Light Source Sampling
The Graphics Rendering Pipeline
© University of Wisconsin, CS559 Fall 2004
Presentation transcript:

Visibility Queries Using Graphics Hardware Presented by Jinzhu Gao

Motivation Visibility queries is popular used in different applications – 70% of total computation time in hierarchical radiosity Graphics hardware provides fast access to the data computed by the graphics hardware

Point-based Visibility Query Visibility queries with the same starting point and different ending points For example: – Eye ray-tracing – A point light source illuminating a scene

Visibility Methods Ray casting Z-buffer Using object ID image HP Extensions NV Extensions

Using Object ID Image Basic Idea: – Assign a specific color for each element in the scene – Render all the elements in the scene – The first surface in a given direction is the one with the color of the pixel intersected in this direction

Using Object ID Image Advantage: – Easy to implement – Extremely fast Disadvantage: – Have aliasing errors

Using Object ID Image Aliasing errors – Sampling the scene using a regular grid – Visibility query is at different points than the original samples

Using Object ID Image Solution: – Querying neighboring pixels – If all correspond to same surface, answer is correct – Otherwise, just use ray-casting or enhance the image resolution

Performance Test results on a Silicon Graphics RealityEngine II

Conclusion The ID images gives us rapid answers in places where there are no problems Use ray-casting for small problems that concern few visibility queries Use a better ID image for larger problems that concern several visibility queries

HP Occlusion Test (1) Extension Name: HP_occlusion_test Provides a visibility determination mechanism After rendering, query if any of the geometry could have or did modify the depth buffer. – False = geometry could not have affected depth buffer – True = it could have or did modify depth buffer

HP Occlusion Test (2) The object is not visible if the test fails (returns false) It is visible if the test passes (returns true) Typical usage: – Render bounding box for target geometry. – If test fails, you can skip the geometry altogether.

HP Occlusion Test – How to Use (Optional) Disable updates to color/depth buffers glDepthMask(GL_FALSE) glColorMask(GL_FALSE,GL_FALSE,GL_FALSE,GL_FALSE) Enable occlusion test glEnable(GL_OCCLUSION_TEST_HP) Render (bounding) geometry Disable occlusion test glDisable(GL_ OCCLUSION_TEST_HP) Read occlusion test result glGetBooleanv(GL_OCCLUSION_TEST_RESULT_HP,&result)

HP Occlusion Test - Limitations Returns a simple TRUE or FALSE Often useful to know how many pixels were rendered Uses a “stop-and-wait” model for multiple tests Driver has to stop and wait for result of previous test before beginning next test Mediocre performance for multiple tests Eliminates parallelism between CPU and GPU

NV Occlusion Query (1) Extension name: NV_occlusion_query Solves problems in HP_occlusion_test Returns pixel count – the no. of pixels that pass Provides an interface to issue multiple queries at once before asking for the result of any one Applications can now overlap the time it takes for the queries to return with other work increasing the parallelism between CPU and GPU

NV Occlusion Query – How to Use (1) (Optional) Disable Depth/Color Buffers (Optional) Disable any other irrelevant non-geometric state Generate occlusion queries – Begin i th occlusion query – Render i th (bounding) geometry End occlusion query Do other CPU computation while queries are being made (Optional) Enable Depth/Color Buffers (Optional) Re-enable other state Get pixel count of i th query If (count > MAX_COUNT) render i th geometry

NV Occlusion Query – How to Use (2) Generate occlusion queries Gluint queries[N]; GLuint pixelCount; glGenOcclusionQueriesNV(N, queries); Loop over queries for (i = 0; i < N; i++) { glBeginOcclusionQueryNV(queries[i]); // render bounding box for i th geometry glEndOcclusionQueryNV(); } Get pixel counts for (i = 0; i < N; i++) { glGetOcclusionQueryuivNV(queries[i], GL_PIXEL_COUNT_NV, &pixelCount); if (pixelCount > MAX_COUNT) // render i th geometry }

Example – Incremental Object-Level Culling Rendering a bounding box will cost you fill Need to be more intelligent in how you issue queries! Good if you use query for object that you were going to render in any case Skip the occlusion queries for visible objects for the next few frames.

Incremental Object-Level Culling (2) Render scene from front-to-back Draw the big occluders first Issue queries for other objects in the scene If query returns 0 in first pass, you can skip the object in subsequent passes If object is occluded, it will get eliminated at worst in the second pass.

Conclusion Simple to use in applications yet very powerful Provides pixel count – a very useful quantity Can be used asynchronously, more parallelism for you and me Versatile extension that can be used in a wide variety of algorithms/applications