Accelerated Raytracing

Similar documents
Anti-aliased and accelerated ray tracing. University of Texas at Austin CS384G - Computer Graphics

Anti-aliased and accelerated ray tracing. University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell

Spatial Data Structures

Acceleration Data Structures

Ray Tracing Acceleration Data Structures

Spatial Data Structures

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

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

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

Spatial Data Structures

Spatial Data Structures

Ray Tracing. Cornell CS4620/5620 Fall 2012 Lecture Kavita Bala 1 (with previous instructors James/Marschner)

Spatial Data Structures

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

Intersection Acceleration

Accelerating Ray Tracing

Accelerating Ray-Tracing

Computer Graphics. - Spatial Index Structures - Philipp Slusallek

Ray Intersection Acceleration

Parallel Physically Based Path-tracing and Shading Part 3 of 2. CIS565 Fall 2012 University of Pennsylvania by Yining Karl Li

improving raytracing speed

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

Topics. Ray Tracing II. Intersecting transformed objects. Transforming objects

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

Topics. Ray Tracing II. Transforming objects. Intersecting transformed objects

Questions from Last Week? Extra rays needed for these effects. Shadows Motivation

CS 431/636 Advanced Rendering Techniques

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

Logistics. CS 586/480 Computer Graphics II. Questions from Last Week? Slide Credits

MSBVH: An Efficient Acceleration Data Structure for Ray Traced Motion Blur

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

CS580: Ray Tracing. Sung-Eui Yoon ( 윤성의 ) Course URL:

CPSC / Sonny Chan - University of Calgary. Collision Detection II

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

Ray Tracing Acceleration. CS 4620 Lecture 20

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

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

Lecture 2 - Acceleration Structures

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

Ray Intersection Acceleration

Advanced Ray Tracing

Sung-Eui Yoon ( 윤성의 )

EDAN30 Photorealistic Computer Graphics. Seminar 2, Bounding Volume Hierarchy. Magnus Andersson, PhD student

Speeding Up Ray Tracing. Optimisations. Ray Tracing Acceleration

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

CS535 Fall Department of Computer Science Purdue University

Acceleration Data Structures for Ray Tracing

Ray Genealogy. Raytracing: Performance. Bounding Volumes. Bounding Volume. Acceleration Classification. Acceleration Classification

Ray Tracing Acceleration. CS 4620 Lecture 22

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

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

Scene Management. Video Game Technologies 11498: MSc in Computer Science and Engineering 11156: MSc in Game Design and Development

Computer Graphics. Bing-Yu Chen National Taiwan University

Ray Casting. To Do. Outline. Outline in Code. Foundations of Computer Graphics (Spring 2012) Heckbert s Business Card Ray Tracer

Effects needed for Realism. Ray Tracing. Ray Tracing: History. Outline. Foundations of Computer Graphics (Spring 2012)

Computer Graphics Ray Casting. Matthias Teschner

Bounding Volume Hierarchies. CS 6965 Fall 2011

Collision Detection. These slides are mainly from Ming Lin s course notes at UNC Chapel Hill

Acceleration Structures. CS 6965 Fall 2011

SPATIAL DATA STRUCTURES. Jon McCaffrey CIS 565

Effects needed for Realism. Computer Graphics (Fall 2008) Ray Tracing. Ray Tracing: History. Outline

Ray Tracing: Intersection

Recall: Inside Triangle Test

Spatial Data Structures. Steve Rotenberg CSE168: Rendering Algorithms UCSD, Spring 2017

Collision and Proximity Queries

Reading Ray Intersection Chapter 2: Geometry and Transformations Acceleration Covers basic math and PBRT implementation: read on your own

Advanced 3D-Data Structures

A Model to Evaluate Ray Tracing Hierarchies

Ray Tracing. Outline. Ray Tracing: History

Lighting. To do. Course Outline. This Lecture. Continue to work on ray programming assignment Start thinking about final project

Warped parallel nearest neighbor searches using kd-trees

Consider a partially transparent object that is illuminated with two lights, one visible from each side of the object. Start with a ray from the eye

CPSC GLOBAL ILLUMINATION

Acceleration Data Structures. Michael Doggett Department of Computer Science Lund university

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

Spatial Data Structures and Acceleration Algorithms

Topic 12: Texture Mapping. Motivation Sources of texture Texture coordinates Bump mapping, mip-mapping & env mapping

Motivation. Sampling and Reconstruction of Visual Appearance. Effects needed for Realism. Ray Tracing. Outline

Topic 11: Texture Mapping 11/13/2017. Texture sources: Solid textures. Texture sources: Synthesized

Homework 1: Implicit Surfaces, Collision Detection, & Volumetric Data Structures. Loop Subdivision. Loop Subdivision. Questions/Comments?

COMP 175: Computer Graphics April 11, 2018

Topic 11: Texture Mapping 10/21/2015. Photographs. Solid textures. Procedural

Lecture 11: Ray tracing (cont.)

Holger Dammertz August 10, The Edge Volume Heuristic Robust Triangle Subdivision for Improved BVH Performance Holger Dammertz, Alexander Keller

Ray tracing. EECS 487 March 19,

Solid Modeling. Thomas Funkhouser Princeton University C0S 426, Fall Represent solid interiors of objects

Hidden Surface Elimination: BSP trees

Ray Tracing Performance

Accelerating Ray-Scene Intersection Calculations

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

VIII. Visibility algorithms (II)

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

Row Tracing with Hierarchical Occlusion Maps

Ray Tracing. Foley & Van Dam, Chapters 15 and 16

Ray Tracing Foley & Van Dam, Chapters 15 and 16

Soft Shadow Volumes for Ray Tracing with Frustum Shooting

Graphics 2009/2010, period 1. Lecture 8: ray tracing

11 - Spatial Data Structures

Spatial Data Structures and Acceleration Algorithms

Spatial Data Structures for Computer Graphics

Transcription:

Accelerated Raytracing

Why is Acceleration Important? Vanilla ray tracing is really slow! mxm pixels, kxk supersampling, n primitives, average ray path length of d, l lights, 2 recursive ray casts per intersection What s one way to reduce this that we ve discussed in class?

Reducing These Terms Early ray termination Reduce levels of recursion Adaptive ray sampling Reduces k supersampling term Faster intersections Generalized rays

Ray Tracing Acceleration Techniques Approaches Faster Intersection Fewer Rays Generalized Rays N 1 Uniform grids Spatial hierarchies k-d, oct-tree, bsp hierarchical grids Hierarchical bounding volumes (HBV) Tighter bounds Faster intersector Early ray termination Adaptive sampling Beam tracing Cone tracing Pencil tracing

Faster Intersections Optimize the intersection test Reduce the number of intersections along d to reduce the number of intersection tests

Spatial Acceleration Structures Idea: Index data by spatial location Geometry s position in the world affects its likelihood of being seen/ intersected Fast, approximate queries can eliminate distant or hidden objects

Uniform Spatial Subdivision Partition space into cells (voxels) Associate primitives with all cells it overlaps Trace through voxel array using fast incremental arithmetic

Uniform Grid Preprocessing Find world bounding box Determine grid resolution Place objects into cells that overlap it

Uniform Grid Traversal 3D Digital Differential Analyzer (3DDDA) DDA calculates increment in linear interpolation to touch all cells Line segment between start and end position within the grid Intersect geometry within visited cells

Potential Errors in Overlap Solve redundancy and accuracy issues with mailboxes Each object has a mailbox to store intersection results Each ray has a distinct number Only intersect if ray does not already have an intersection Look for intersection only within current voxel

Spatial Hierarchies Cells of parent completely contains all cells of children If a query fails in a cell, it will fail for all children If a query succeeds, try the children Only if query reaches a leaf do we perform the expensive intersection test

Non-Uniform Spatial Subdivision Partitioning Approach: Octrees, k-d trees, BSP trees Non-partitioning approach: Bounding volume hierarchies

Spatial Partitions kd-tree oct-tree bsp-tree

Octree Eight children per parent Objects in leaf nodes Extents of cube can be inferred or stored

Octree Problems Octrees unbalanced if objects aren t uniformly distributed Teapot in the stadium A bad octree case

k-d Trees Octree problem: Cube always split evenly between children Solution: Allow for splits at variable positions!

k-d Tree Properties Node represents rectilinear region (axisaligned) Axis-aligned planes split region into two Direction of cutting planes alternate with depth Cut planes in different sub-trees at same sub level not necessarily the same

k-d Tree Example 2 4 8 10 12 6 11 3 13 1 2 3 4 5 6 7 9 8 9 10 11 12 13 5 1 7

k-d Tree Build

L R

L RL R RR

L RL R RR RRL RRR

LL L LR RL R RR RRL RRR

LLL LL L LLR LR RL R RR RRL RRR

LLL LL L LLR LR RL R RR LLLL LLLR RRL RRR

LL L LR RL R RR LLL LLR LRL LRR RRL RRR LLLL LLLR

LL L LR RL R RR LLL LLR LRL LLLL LLLR LRLR LRLL LRR RRL RRR

LL L LR RL R RR LLL LLR LRL LRLR LLLL LLLR LRLL LRLRL LRR LRLRR RRL RRR

Where to Split Nodes? How to decide which split plane to use in a given node? What are some possible criteria?

Split Plane Criteria Balance cost of building k-d tree with cost of traversal (number of steps) and intersection test

Spatial Median Splitting Simplest naive method Dimension of sub-tree s split plane p chosen in round robin fashion Plane positioned at spatial median of voxel Terminate recursion when number of triangles in node are below a threshold, or tree depth exceeds maximum depth

Spatial Median Issues Does not consider geometry of scene Can gain speed ups by maximizing empty space toward root node

Surface Area Metric Representation of ray traversal cost for a split: Cost(split) = C s + P L C L + P R C R C s is cost of node traversal (constant) C L and C r are costs of left and right children (based on number of primitives on that side) P L and P r are probabilities of ray hitting that child (assumes uniform ray distribution, so is surface area ratio of child to parent)

Surface Area Heuristic Greedy, top down approach to tree construction 1. Consider a collection of scene partitions 2. Evaluate candidate using SAM 3. Partition along best candidate and recurse to left and right child

Axis-Aligned Bounding Boxes Further reduce candidate split planes Build time is important since k-d tree is rebuilt after every time step!

k-d Tree Traversal L R Stack: LLL LL LLR LR LRL RL RR Current: Root LLLL LLLR LRLL LRLRL LRLR LRR LRLRR RRL RRR

L R Stack: R LLL LL LLR LR LRL RL RR Current: L LLLL LLLR LRLL LRLRL LRLR LRR LRLRR RRL RRR

L R Stack: R LLL LL LLR LR LRL RL RR Current: LL LLLL LLLR LRLL LRLRL LRLR LRR LRLRR RRL RRR

L R Stack: LLR,R LLL LL LLR LR LRL RL RR Current: LLL LLLL LLLR LRLL LRLRL LRLR LRR LRLRR RRL RRR

L R Stack: LLR,R LLL LL LLR LR LRL RL RR Current: LLLR LLLL LLLR LRLL LRLRL LRLR LRR LRLRR RRL RRR

L R Stack: R LLL LL LLR LR LRL RL RR Current: LLL LLLL LLLR LRLL LRLRL LRLR LRR LRLRR RRL RRR

L R Stack: LLL LL LLR LR LRL RL RR Current: R LLLL LLLR LRLL LRLRL LRLR LRR LRLRR RRL RRR

L R Stack: RR LLL LL LLR LR LRL RL RR Current: RL LLLL LLLR LRLL LRLRL LRLR LRR LRLRR RRL RRR

L R Stack: LLL LL LLR LR LRL RL RR Current: RR LLLL LLLR LRLL LRLRL LRLR LRR LRLRR RRL RRR

L R Stack: LLL LL LLR LR LRL RL RR Current: RRR LLLL LLLR LRLL LRLRL LRLR LRR LRLRR RRL RRR

L R LL LR RL RR LLL LLR LRL LRLR LRR RRL RRR LLLL LLLR LRLL LRLRL LRLRR

BSP Trees 1 2 Binary Space Partition Trees 6 4 C A 5B D 8 7 3 Cutting planes can be any orientation Industry standard for spatial subdivision in many game environments

Bounding Volume Hierarchies Bounding volume for each object Sphere, AABBs, etc Parents bounds bound child s bounds No notion of cells Bounding volumes can overlap

BVH Example Ideally have: Tight bounding volumes Balanced trees

Current Global Illumination

Bidirectional Pathtracing Shoot rays from light source in addition to scene Gather rays from pixel based on light sources on surfaces

Naturally Captures: Soft shadows Caustics Depth of field Motion blur Indirect light Glossy and blurred reflections

Brigade https://www.youtube.com/watch? v=fbgm66dcwok

Cascading Light Propagation Volumes https://www.youtube.com/watch? v=vpq3bbuyvh8

VXGI https://www.youtube.com/watch? v=ch2_rkfstsk

Enlighten https://www.youtube.com/watch? v=6fs-4kvp2nm

Additional Examples http://realtimeradiosity.com/demos/