Real-Time Voxelization for Global Illumination

Similar documents
Voxel Cone Tracing and Sparse Voxel Octree for Real-time Global Illumination. Cyril Crassin NVIDIA Research

Octree-Based Sparse Voxelization for Real-Time Global Illumination. Cyril Crassin NVIDIA Research

Last Time: Acceleration Data Structures for Ray Tracing. Schedule. Today. Shadows & Light Sources. Shadows

CS354R: Computer Game Technology

Ray Tracing. Computer Graphics CMU /15-662, Fall 2016

Spatial Data Structures

In the previous presentation, Erik Sintorn presented methods for practically constructing a DAG structure from a voxel data set.

Spatial Data Structures

Spatial Data Structures

Volume-based Ambient Occlusion with Voxel Fragmentation

CMSC427 Advanced shading getting global illumination by local methods. Credit: slides Prof. Zwicker

Spatial Data Structures

Ray Tracing Acceleration Data Structures

Hello, Thanks for the introduction

TDA362/DIT223 Computer Graphics EXAM (Same exam for both CTH- and GU students)

After the release of Maxwell in September last year, a number of press articles appeared that describe VXGI simply as a technology to improve

Accelerating Geometric Queries. Computer Graphics CMU /15-662, Fall 2016

Shadows. COMP 575/770 Spring 2013

Enhancing Traditional Rasterization Graphics with Ray Tracing. October 2015

global light baking software

Hardware Accelerated Volume Visualization. Leonid I. Dimitrov & Milos Sramek GMI Austrian Academy of Sciences

Lecture 11: Ray tracing (cont.)

Ambien Occlusion. Lighting: Ambient Light Sources. Lighting: Ambient Light Sources. Summary

CSL 859: Advanced Computer Graphics. Dept of Computer Sc. & Engg. IIT Delhi

Spatial Data Structures

Computer Graphics. - Ray-Tracing II - Hendrik Lensch. Computer Graphics WS07/08 Ray Tracing II

Computer Graphics. Bing-Yu Chen National Taiwan University The University of Tokyo

Enhancing Traditional Rasterization Graphics with Ray Tracing. March 2015

Today. Acceleration Data Structures for Ray Tracing. Cool results from Assignment 2. Last Week: Questions? Schedule

The Rasterization Pipeline

Lecture 25 of 41. Spatial Sorting: Binary Space Partitioning Quadtrees & Octrees

Interactive Methods in Scientific Visualization

Visibility and Occlusion Culling

Pipeline Operations. CS 4620 Lecture Steve Marschner. Cornell CS4620 Spring 2018 Lecture 11

Rasterization Overview

Computer Graphics Ray Casting. Matthias Teschner

Ray Tracing III. Wen-Chieh (Steve) Lin National Chiao-Tung University

S U N G - E U I YO O N, K A I S T R E N D E R I N G F R E E LY A VA I L A B L E O N T H E I N T E R N E T

Spatial Data Structures and Speed-Up Techniques. Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology

Ray-tracing Acceleration. Acceleration Data Structures for Ray Tracing. Shadows. Shadows & Light Sources. Antialiasing Supersampling.

Applications of Explicit Early-Z Culling

Speeding up your game

Next-Generation Graphics on Larrabee. Tim Foley Intel Corp

Pipeline Operations. CS 4620 Lecture 14

Point based Rendering

Advanced Ray Tracing

Hidden surface removal. Computer Graphics

Announcements. Written Assignment2 is out, due March 8 Graded Programming Assignment2 next Tuesday

Intersection Acceleration

Computing Visibility. Backface Culling for General Visibility. One More Trick with Planes. BSP Trees Ray Casting Depth Buffering Quiz

Chapter 11 Global Illumination. Part 1 Ray Tracing. Reading: Angel s Interactive Computer Graphics (6 th ed.) Sections 11.1, 11.2, 11.

INFOGR Computer Graphics. J. Bikker - April-July Lecture 11: Visibility. Welcome!

Deferred Rendering Due: Wednesday November 15 at 10pm

Computer Graphics. Bing-Yu Chen National Taiwan University

Computer Graphics Shadow Algorithms

Shadows for Many Lights sounds like it might mean something, but In fact it can mean very different things, that require very different solutions.

CS 563 Advanced Topics in Computer Graphics Culling and Acceleration Techniques Part 1 by Mark Vessella

Global Illumination CS334. Daniel G. Aliaga Department of Computer Science Purdue University

GPU-Accelerated Deep Shadow Maps for Direct Volume Rendering

CHAPTER 1 Graphics Systems and Models 3

Dynamic Ambient Occlusion and Indirect Lighting. Michael Bunnell NVIDIA Corporation

TDA361/DIT220 Computer Graphics, January 15 th 2016

DEFERRED RENDERING STEFAN MÜLLER ARISONA, ETH ZURICH SMA/

NVIDIA Case Studies:

Global Rendering. Ingela Nyström 1. Effects needed for realism. The Rendering Equation. Local vs global rendering. Light-material interaction

CS 498 VR. Lecture 18-4/4/18. go.illinois.edu/vrlect18

Parallel Triangle Rendering on a Modern GPU

Computer Graphics (CS 543) Lecture 13b Ray Tracing (Part 1) Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)

Volume Rendering - Introduction. Markus Hadwiger Visual Computing Center King Abdullah University of Science and Technology

Rendering. Converting a 3D scene to a 2D image. Camera. Light. Rendering. View Plane

CS 130 Exam I. Fall 2015

Ray Tracing with Spatial Hierarchies. Jeff Mahovsky & Brian Wyvill CSC 305

Point Cloud Filtering using Ray Casting by Eric Jensen 2012 The Basic Methodology

Accelerated Raytracing

Particle systems, collision detection, and ray tracing. Computer Graphics CSE 167 Lecture 17

Practical Techniques for Ray Tracing in Games. Gareth Morgan (Imagination Technologies) Aras Pranckevičius (Unity Technologies) March, 2014

Acknowledgement: Images and many slides from presentations by Mark J. Kilgard and other Nvidia folks, from slides on developer.nvidia.

Advanced Computer Graphics CS 563: Screen Space GI Techniques: Real Time

CSE 167: Introduction to Computer Graphics Lecture #4: Vertex Transformation

CS GPU and GPGPU Programming Lecture 2: Introduction; GPU Architecture 1. Markus Hadwiger, KAUST

Interactive Isosurface Ray Tracing of Large Octree Volumes

C P S C 314 S H A D E R S, O P E N G L, & J S RENDERING PIPELINE. Mikhail Bessmeltsev

RASTERISED RENDERING

Real-Time Shadows. Computer Graphics. MIT EECS Durand 1

Spatial Data Structures for Computer Graphics

CSE 167: Introduction to Computer Graphics Lecture #9: Visibility. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2018

CS4620/5620: Lecture 14 Pipeline

COMP 175: Computer Graphics April 11, 2018

Real-time ray tracing

Acceleration Data Structures

Introduction to Visualization and Computer Graphics

Lecture 17: Solid Modeling.... a cubit on the one side, and a cubit on the other side Exodus 26:13

Computer Graphics (CS 543) Lecture 10: Soft Shadows (Maps and Volumes), Normal and Bump Mapping

Pipeline Operations. CS 4620 Lecture 10

Soft shadows. Steve Marschner Cornell University CS 569 Spring 2008, 21 February

Adaptive Point Cloud Rendering

Sampling, Aliasing, & Mipmaps

Overview. Pipeline implementation I. Overview. Required Tasks. Preliminaries Clipping. Hidden Surface removal

Ray Casting. Outline in Code. Outline. Finding Ray Direction. Heckbert s Business Card Ray Tracer. Foundations of Computer Graphics (Fall 2012)

Volume Graphics Introduction

Transcription:

Lecture 26: Real-Time Voxelization for Global Illumination Visual Computing Systems

Voxelization to regular grid Input: scene triangles Output: surface information at each voxel in 3D grid - Simple case: voxel stores presence (does voxel contain geometry) - More complex case: voxel stores shading parameters (e.g., normal, albedo) [Image credit: Crassin and Green, OpenGL Insights]

Voxelization as conservative 3D-rasterization Fragment generation: - 2D point-in-projected triangle coverage test triangle-3d-box intersection test Image credits: [Crassin and Green, OpenGL Insights] [Schwarz and Sidel 2010] Simpler example: 26-separating (fully conservative) 6-separating ( thin voxelization)

Basics: voxelization using GPU rasterizer z Rough algorithm sketch: rasterize scene with orthographic projection, and without Z-cull

Resulting fragments z Rough algorithm sketch: rasterize scene with orthographic projection, and without Z-cull Voxel containing fragment = (frag.x, frag.y, floor(frag.z / z));

Voxelization using GPU rasterizer Consider case: triangle normal near-orthogonal from axis of projection z

Resulting fragments Rasterization generates one fragment per triangle per screen pixel Problem: discontinuous voxelized representation of surface z

Dominant axis determination Single pass geometry shader implementation: - Use dot product of triangle s normal and each of three potential axes to choose dominant axis (per triangle Geometry Shader operation) - Project triangle orthogaphically along chosen axis Rasterizer (emit projected vertices to rasterizer)

Fragment may overlap up to multiple voxels Compute voxel overlap given Z(x,y) (depth at pixel center), dzdx, dzdy z

Writing to 3D voxel data structure Fragment must update voxel data structure with surface color, normal, etc. information - frag.xy + axis of projection identifies column of voxels - fragment depth identifies overlapped voxels Multiple fragments will overlap same voxels Arbitrary memory access: - Use new GLSL Shader Model 5 image load/store operations or load/store to buffer textures Synchronization: - Ensure atomicity of updates using compare_and_swap Many-to-one reduction: - Average surface attributes over all fragments contributing to each voxel - Occupancy: OR - Albedo: average - Normal?

Problem Rasterizer only point-samples coverage: if projected triangle does not cover pixel center, no fragments will be generated Particularly pronounced with thin geometry [Schwarz and Sidel 2010] Three-plane rasterization

Conservative rasterization by enlarging triangle Current GPU hardware solution: - Generate bounding polygon in geometry shader - Extend bounds by up to one pixel - Fragment shader kills fragments that lie outside clipping region Conservative rasterization to accelerate voxelization is an attractive feature for future hardware rasterizers [Credit: Crassin and Green, OpenGL Insights]

Basic GPU rasterizer-accelerated voxelization Single-pass geometry shader implementation: - Use dot product of triangle s normal and each of three potential axes to choose dominant axis (per triangle operation) - Enlarge triangle to enable conservative voxelization - Project triangle along chosen axis (emit projected vertices to rasterizer) Rasterizer generates fragments (performs part of triangle-voxel overlap computation) Fragment shader computes covered voxels and samples surface attributes Fragment shader updates 3D voxel grid data structure in parallel using global synchronization constructs - Note: fixed-function GL frame-buffer functionality NOT used Alternative: implement voxelization entirely in software (using CUDA or compute shader) Geometry Shader Rasterizer Fragment Shader voxel grid

Problem: storage cost of 3D representation Modest size 512 x 512 x 512 voxel grid, 8 bytes per pixel (albedo + normal) - 1 GB footprint Solutions for reducing footprint: - Compress data stored in voxels (e.g., lossy compress using low bit precision... think G-buffer packing techniques for deferred renderer) - Use sparse representation of voxel grid (only store voxels where surfaces actually exist)

Sparse voxel octree (SVO) - Compact, multi-resolution voxel data-structure - Each node corresponds to axis-aligned region in space (root node = the entire scene) - Each node maintains pre-filtered representation of it s region of space (below: a 3x3 dense voxel grid called a brick ) - 3D space: each node subdivided uniformly into eight child nodes (child only allocated if it exists) Simplified illustration: Only two nodes for each interior node shown. [Figure credit: Crassin and Green, OpenGL Insights]

Constructing a SVO on the GPU Step 1: build list of fragments (voxelize to finest resolution) - Fragment shader appends voxel fragment to list - Append synchronization via atomic counter ( next pointer) Step 2: for each level of octree: from top to bottom - For each fragment in list, mark child cell containing fragment as occupied - Allocate occupied child cells - Initialize child cells [Figure credit: Crassin and Green, OpenGL Insights]

Constructing a SVO on the GPU Step 3: initialize octree values - Initialize leaf bricks (copy surface attributes from voxel fragment list) - For each interior node: - Resample values from (up to eight) children nodes to construct brick values for current node - Note: resampling of binary occupancy at leaves yields opacity Visualization of surface albedo stored at three difference voxel grid resolutions [Figure credit: Crassin and Green, OpenGL Insights]

More examples [Credit: Cyril Crassin BPS 2012]

Ray casting through voxel grid Ray: p(t) = o + dt Ray intersects plane perpendicular to x axis at: Let x0 be x-aligned plane of box closest to ray origin, x1 be farthest Range of t values for which ray is in cube (x0,y0,z0), (x1,y1,z1): (x1, y1) - tmin = max(tx(x 0 ),ty(y0),tz(z0)) - tmax = min(tx(x1),ty(y1),tz(z1)) Advancing to next box at same same level of grid: - Compare t x (x 1 ),t y (y 1 ),t z (z 1 ) with tmax, advance cell index (x0, y0) in all dimensions value is equal - In octree: just flip bits of index for each dimension! - Incompatibility between bit flip direction and ray direction indices out of octree node (must pop up a level) Descending to lower levels: - Determine starting voxel by checking tmin against node midpoint planes

Voxel cone tracing Main idea: rather than compute integrals during rendering by stochastic point sampling (requiring tracing of many rays through scene to produce low variance estimates), efficiently estimate integral over cone of rays traced through prefiltered voxel representation of geometry Treat prefiltered geometry as a participating media (density field) rather a definite surface [Credit: Cyril Crassin BPS 2012]

Review: attenuation along a ray [Credit: Crassin et al. 2011]

Integrate over bundle of rays [Credit: Crassin et al. 2011]

Discretize integrals along rays [Credit: Crassin et al. 2011]

Pre-integrate volumes Move integration over bundle of rays into summation over voxels Sum emission over all voxels, modulated by attenuation due to opacity - Makes de-correlation assumption (of energy and opacity) [Credit: Crassin et al. 2011]

Voxel cone tracing: integration over cone of rays [Credit: Crassin et al. 2011]

Ambient Occlusion Scene model courtesy of Guillermo M. Leal Llaguno Fraction of distant incoming irradiance attenuated by occluders (integration of occlusion over hemisphere) Coarse proxy for shadowing of ambient indirect illumination [Credit: Crassin et al. 2011]

Ambient occlusion via voxel cone tracing Store prefiltered occlusion value at each octree node Step cone from surface point through octree: Octree depth and determined from cone width - Use deep voxels near starting surface point, higher (larger) voxels farther away [Credit: Crassin et al. 2011]

Comparison with ray traced AO solution Voxel cone tracing using three cones [Credit: Crassin et al. 2011]

Indirect illumination using voxel cone tracing Step 1: compute direct illumination due to light source at every leaf voxel - Render W x H light-view-map image from light. - For every fragment sample, trace through SVO, deposit irradiance in leaf - Requires atomic update of data structure (similar to SVO construction) Step 2: filter irradiance values to higher levels of octree - Store Gaussian lobes in voxels: direction + variance Step 3: (Gather phase) In standard forward or deferred rendering use cone tracing to compute indirect illumination at every fragment - - cvoxel is radiance from voxel reflected in direction of gathering surface (cone origin)

Scene model courtesy of Guillermo M. Leal Llaguno Examples [Credit: Crassin et al.]

Discussion Increasing use of voxelization techniques in interactive rendering When are voxelization techniques applicable? - When the cost of pre-filtering can be amortized! - Amortize construction/pre-filtering over many queries in a frame (e.g., GI) - Or over many frames (e.g., static geometry) Why not just drop triangles all together? - e.g. Ray cast through voxel representation for primary rays

Credits This lecture used figures from: - Crassin et al. 2011 - Cyril Crassin s BPS 2012 talk - Crassin and Green s Chapter 22 of OpenGL Insights (Cozzi and Riccio)