Two Methods for Fast Ray-Cast Ambient Occlusion Samuli Laine and Tero Karras NVIDIA Research.

Slides:



Advertisements
Similar presentations
An Optimized Soft Shadow Volume Algorithm with Real-Time Performance Ulf Assarsson 1, Michael Dougherty 2, Michael Mounier 2, and Tomas Akenine-Möller.
Advertisements

Christian Lauterbach COMP 770, 2/16/2009. Overview  Acceleration structures  Spatial hierarchies  Object hierarchies  Interactive Ray Tracing techniques.
Solving Some Common Problems in a Modern Deferred Rendering Engine
Restart Trail for Stackless BVH Traversal Samuli Laine NVIDIA Research.
Optimized Stencil Shadow Volumes
Computer graphics & visualization Global Illumination Effects.
Collision Detection CSCE /60 What is Collision Detection?  Given two geometric objects, determine if they overlap.  Typically, at least one of.
Computer graphics & visualization Collisions. computer graphics & visualization Simulation and Animation – SS07 Jens Krüger – Computer Graphics and Visualization.
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.
Stratified Sampling for Stochastic Transparency
Week 10 - Monday.  What did we talk about last time?  Global illumination  Shadows  Projection shadows  Soft shadows.
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.
I3D Fast Non-Linear Projections using Graphics Hardware Jean-Dominique Gascuel, Nicolas Holzschuch, Gabriel Fournier, Bernard Péroche I3D 2008.
Christian Lauterbach COMP 770, 2/11/2009
Tomas Mőller © 2000 Speeding up your game The scene graph Culling techniques Level-of-detail rendering (LODs) Collision detection Resources and pointers.
Practical and Robust Stenciled Shadow Volumes for Hardware-Accelerated Rendering Cass Everitt and Mark J. Kilgard Speaker: Alvin Date: 5/28/2003 NVIDIA.
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,
Approximate Soft Shadows on Arbitrary Surfaces using Penumbra Wedges Tomas Akenine-Möller Ulf Assarsson Department of Computer Engineering, Chalmers University.
Apex Point Map for Constant-Time Bounding Plane Approximation Samuli Laine Tero Karras NVIDIA.
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.
Introduction to 3D Graphics John E. Laird. Basic Issues u Given a internal model of a 3D world, with textures and light sources how do you project it.
Computer Graphics Shadows
1 A Hierarchical Shadow Volume Algorithm Timo Aila 1,2 Tomas Akenine-Möller 3 1 Helsinki University of Technology 2 Hybrid Graphics 3 Lund University.
Hidden Surface Removal
Afrigraph 2004 Massive model visualization Tutorial A: Part I Rasterization Based Approaches Andreas Dietrich Computer Graphics Group, Saarland University.
Cornell CS465 Fall 2004 Lecture 3© 2004 Steve Marschner 1 Ray Tracing CS 465 Lecture 3.
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
Shadow Algorithms Ikrima Elhassan.
Ray Tracing and Photon Mapping on GPUs Tim PurcellStanford / NVIDIA.
01/28/05© 2005 University of Wisconsin Last Time Improving Monte Carlo Efficiency.
The Visibility Problem In many environments, most of the primitives (triangles) are not visible most of the time –Architectural walkthroughs, Urban environments.
Lecture 3 : Direct Volume Rendering Bong-Soo Sohn School of Computer Science and Engineering Chung-Ang University Acknowledgement : Han-Wei Shen Lecture.
Interactive Rendering of Meso-structure Surface Details using Semi-transparent 3D Textures Vision, Modeling, Visualization Erlangen, Germany November 16-18,
On a Few Ray Tracing like Algorithms and Structures. -Ravi Prakash Kammaje -Swansea University.
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.
Collaborative Visual Computing Lab Department of Computer Science University of Cape Town Graphics Topics in VR By Shaun Nirenstein.
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.
Interactive Rendering With Coherent Ray Tracing Eurogaphics 2001 Wald, Slusallek, Benthin, Wagner Comp 238, UNC-CH, September 10, 2001 Joshua Stough.
Computer Graphics 2 Lecture 7: Texture Mapping Benjamin Mora 1 University of Wales Swansea Pr. Min Chen Dr. Benjamin Mora.
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
Sample Based Visibility for Soft Shadows using Alias-free Shadow Maps Erik Sintorn – Ulf Assarsson – uffe.
Hierarchical Penumbra Casting Samuli Laine Timo Aila Helsinki University of Technology Hybrid Graphics, Ltd.
Interactive Ray Tracing of Dynamic Scenes Tomáš DAVIDOVIČ Czech Technical University.
Global Illumination. Local Illumination  the GPU pipeline is designed for local illumination  only the surface data at the visible point is needed to.
Real-Time Depth Buffer Based Ambient Occlusion
Coherent Hierarchical Culling: Hardware Occlusion Queries Made Useful Jiri Bittner 1, Michael Wimmer 1, Harald Piringer 2, Werner Purgathofer 1 1 Vienna.
Photo-realistic Rendering and Global Illumination in Computer Graphics Spring 2012 Hybrid Algorithms K. H. Ko School of Mechatronics Gwangju Institute.
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 CS 482 – FALL 2015 SEPTEMBER 29, 2015 RENDERING RASTERIZATION RAY CASTING PROGRAMMABLE SHADERS.
Soft Shadow Volumes for Ray Tracing
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.
Ambient Occlusion Patrick Cozzi University of Pennsylvania CIS Fall 2013.
09/23/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Reflections Shadows Part 1 Stage 1 is in.
Solid Modeling Dr. Scott Schaefer.
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 Soft Shadows with Adaptive Light Source Sampling
Real-Time Ray Tracing Stefan Popov.
Hybrid Ray Tracing of Massive Models
Jim X. Chen George Mason University
© University of Wisconsin, CS559 Fall 2004
Chapter XVI Texturing toward Global Illumination
UMBC Graphics for Games
Frame Buffer Applications
Presentation transcript:

Two Methods for Fast Ray-Cast Ambient Occlusion Samuli Laine and Tero Karras NVIDIA Research

Ambient Occlusion in Theory Occlusion of incoming ambient light Light from these directions reaches the surface Light from these directions does not reach the surface

What It Looks Like

Ambient Occlusion in Practice Use limited range for occlusion  Otherwise everything would be occluded in indoor scenes  Also faster to calculate because of finite radius  Use falloff function to smooth the transition Do not solve analytically  Theoretically doable, but would be ridiculously expensive  Solution: Monte Carlo sampling  256 – 1024 samples is usually enough

Ray Casts for Ambient Occlusion Cast a number of rays from the point to be shaded Determine occlusion distance, apply falloff, sum In reality use a fancy low-discrepancy sampling pattern

Using Shadow Rays Shadow rays are usually faster than ordinary rays  Enough to detect any intersection, not necessarily closest one Can do if we bake falloff function into the rays

Our Contributions Two methods for calculating ambient occlusion faster  One for rasterization-based renderers  One for ray tracing -based renderers No approximations as in screen-space methods Up to ~10–15x speedup over state-of-the-art ray caster

Common Part: Occlusion Masks Both methods keep occlusion status in bit masks  Occlusion of all rays from one point = one bit mask Utilize precalculated look-up tables for fast update of these masks  Update occlusion of all rays at once! Resembles LUTs of hemispherical rasterization paper by Kautz et al. 2004, but more versatile

Occlusion Look-up Table Store binary plane vs. ray occlusion Plane normal & distance from origin  3D table Clever parameterization to avoid singularity at the center

Occlusion Look-up Table Store binary plane vs. ray occlusion Plane normal & distance from origin  3D table Clever parameterization to avoid singularity at the center

Occlusion Look-up Table Store binary plane vs. ray occlusion Plane normal & distance from origin  3D table Clever parameterization to avoid singularity at the center

Occlusion Look-up Table Store binary plane vs. ray occlusion Plane normal & distance from origin  3D table Clever parameterization to avoid singularity at the center

Occlusion Look-up Table Store binary plane vs. ray occlusion Plane normal & distance from origin  3D table Clever parameterization to avoid singularity at the center

Occlusion Look-up Table Store binary plane vs. ray occlusion Plane normal & distance from origin  3D table Clever parameterization to avoid singularity at the center

Occlusion Look-up Table Store binary plane vs. ray occlusion Plane normal & distance from origin  3D table Clever parameterization to avoid singularity at the center

Occlusion Look-up Table Store binary plane vs. ray occlusion Plane normal & distance from origin  3D table Clever parameterization to avoid singularity at the center

Occlusion Look-up Table Store binary plane vs. ray occlusion Plane normal & distance from origin  3D table Clever parameterization to avoid singularity at the center

Occlusion Look-up Table Store binary plane vs. ray occlusion Plane normal & distance from origin  3D table Clever parameterization to avoid singularity at the center

Occlusion Look-up Table Store binary plane vs. ray occlusion Plane normal & distance from origin  3D table Clever parameterization to avoid singularity at the center

Occlusion Look-up Table Store binary plane vs. ray occlusion Plane normal & distance from origin  3D table Clever parameterization to avoid singularity at the center

Occlusion Look-up Table Store binary plane vs. ray occlusion Plane normal & distance from origin  3D table Clever parameterization to avoid singularity at the center

Occlusion Look-up Table Store binary plane vs. ray occlusion Plane normal & distance from origin  3D table Clever parameterization to avoid singularity at the center

Occlusion Look-up Table Store binary plane vs. ray occlusion Plane normal & distance from origin  3D table Clever parameterization to avoid singularity at the center

Occlusion Look-up Table Store binary plane vs. ray occlusion Plane normal & distance from origin  3D table Clever parameterization to avoid singularity at the center

Occlusion Look-up Table Store binary plane vs. ray occlusion Plane normal & distance from origin  3D table Clever parameterization to avoid singularity at the center

Occlusion of a Triangle Combination of four occlusion masks

Using Pre-Calculated Masks look-up table is sufficiently accurate To calculate occlusion of one triangle vs. all occlusion rays from a single receiver point  Transform triangle into coordinate space of receiver point  Calculate triangle plane and edge planes (trivial)  Fetch occlusion masks for all planes  Combine fetched masks together (binary AND)  Combine with current occlusion status (binary OR)

Method 1: Rasterization First render depth and normal buffers For each occluding triangle, rasterize bounds for region of influence For each fragment inside the region of influence, calculate triangle vs. point occlusion and accumulate in frame buffer  Use logic op blending into occlusion bits in frame buffer Bounding the region of influence similar to ambient occlusion volumes by McGuire 2010

Rasterization

Two choices for bounding volume If triangle is large, construct hexagonal prism If triangle is small, construct hemispherical billboard Bounding the Region of Influence Large triangle Small triangle

Fragment Culling Hardware depth test culls fragments where receiver point is behind the region of influence Many culling opportunities remain in fragment shader  Receiver point in front of region of influence (approximate)  Receiver point outside bounding sphere of region of influence  Triangle faces away from receiver point  Receiver point too far from triangle plane  Triangle completely below the horizon of the receiver point Culling tests in shader cuts the number of actually processed fragments by about 80–90%

Level of Detail Optimization Far away occlusion doesn’t care about small details in the occluding surface Therefore, we could use simplified geometry for larger occlusion distances  Nearby occlusion always has to be done using original geometry! Split occlusion distance to various ranges, apply progressively more and more aggressive simplification as the distance grows Can yield 30–140% speedup with tolerable error, depending on the scene

Level of Detail Example

Method 2: BVH Traversal Assume that BVH for scene triangles is available Find occluding triangles by traversing the BVH around the neighborhood of the receiver point Similarities to packet traversal of Wald et al

BVH Traversal Algorithm Maintain cumulative occlusion mask for all AO rays during traversal When making traversal decision, estimate the occlusion potential of current node’s children  Occlusion potential = Number of currently non-blocked rays that are blocked by the bounds of the node If occlusion potential is zero, don’t go there If both children are eligible, first process the one with greater potential  Try to build up occlusion quickly to be able to cull remaining nodes

Calculating Node Occlusion Mask Tried out two kinds of node bounds Boxes  Find silhouette edges, use same mask LUT as for triangles  Tight bounds, but expensive to compute (6 lookups) Spheres  Determine direction and apex angle  Needs a separate 3D LUT for finding the occlusion mask  Conservative bounds, but cheap to compute (1–2 lookups) Found out that spheres gave best overall performance

Triangle Culling After reaching BVH leaf node, process each triangle Apply culling rules for each triangle  Triangle completely below the horizon of the receiver point  Triangle faces away from receiver point  Receiver point too far from triangle plane  Receiver point outside bounding sphere of region of influence If triangle survives, compute occlusion mask and apply to current ray occlusion status

Results Compared against our previous GPU ray caster [Aila and Laine 2009]  Added optimizations for shadow rays Performance measured in Mrays/second Used various ambient occlusion radii

Results

Results: Scalability

Results: Correctness

Future Work Soft shadows from area light sources

Thank You Questions