Acceleration Structure for Animated Scenes. Copyright 2010 by Yong Cao

Similar documents
Ray-Box Culling for Tree Structures

B-KD Trees for Hardware Accelerated Ray Tracing of Dynamic Scenes

Fast kd-tree Construction with an Adaptive Error-Bounded Heuristic

Real Time Ray Tracing

Acceleration Data Structures

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

Computer Graphics. - Spatial Index Structures - Philipp Slusallek

Spatial Data Structures

Early Split Clipping for Bounding Volume Hierarchies

SIMD Ray Stream Tracing - SIMD Ray Traversal with Generalized Ray Packets and On-the-fly Re-Ordering -

Interactive Isosurface Ray Tracing of Large Octree Volumes

Lecture 2 - Acceleration Structures

Spatial Data Structures

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

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

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

Interactive Ray Tracing: Higher Memory Coherence

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

Packet-based Whitted and Distribution Ray Tracing

Packet-based Whitted and Distribution Ray Tracing

Packet-based Whitted and Distribution Ray Tracing

Asynchronous BVH Construction for Ray Tracing Dynamic Scenes on Parallel Multi-Core Architectures

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

Geometric and Arithmetic Culling Methods for Entire Ray Packets

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

Spatial Data Structures

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

Spatial Data Structures

Accelerated Raytracing

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

Recall: Inside Triangle Test

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

Improving Memory Space Efficiency of Kd-tree for Real-time Ray Tracing Byeongjun Choi, Byungjoon Chang, Insung Ihm

Acceleration Data Structures for Ray Tracing

Fast, Effective BVH Updates for Animated Scenes

Realtime Ray Tracing

Using Bounding Volume Hierarchies Efficient Collision Detection for Several Hundreds of Objects

The Minimal Bounding Volume Hierarchy

Accelerating Ray Tracing

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

Intersection Acceleration

Spatial Data Structures

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

Exploiting Local Orientation Similarity for Efficient Ray Traversal of Hair and Fur

Fast BVH Construction on GPUs

Accelerating Ray-Tracing

Ray Tracing Performance

Accelerated Entry Point Search Algorithm for Real-Time Ray-Tracing

Interactive Ray Tracing

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

INFOMAGR Advanced Graphics. Jacco Bikker - February April Welcome!

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

Collision Detection with Bounding Volume Hierarchies

Fast, Effective BVH Updates for Dynamic Ray-Traced Scenes Using Tree Rotations. Abstract

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

Ray Tracing Acceleration. CS 4620 Lecture 20

Object Partitioning Considered Harmful: Space Subdivision for BVHs

Lecture 4 - Real-time Ray Tracing

improving raytracing speed

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

Row Tracing with Hierarchical Occlusion Maps

A Parallel Algorithm for Construction of Uniform Grids

kd-trees for Volume Ray-Casting

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

High Definition Interactive Animated Ray Tracing on CELL Processor using Coherent Grid Traversal

An Improved Multi-Level Raytracing Algorithm

REDUCING RENDER TIME IN RAY TRACING

Dual-Split Trees. Konstantin Shkurko. Daqi Lin. Ian Mallett. Cem Yuksel University of Utah ABSTRACT INTRODUCTION CCS CONCEPTS KEYWORDS

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

Fast and Lazy Build of Acceleration Structures from Scene Hierarchies

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

Collision Detection based on Spatial Partitioning

Ray Intersection Acceleration

Simpler and Faster HLBVH with Work Queues

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

RACBVHs: Random Accessible Compressed Bounding Volume Hierarchies

MULTI-LEVEL GRID STRATEGIES FOR RAY TRACING Improving Render Time Performance for Row Displacement Compressed Grids

Ray Tracing Acceleration. CS 4620 Lecture 22

Collision and Proximity Queries

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

State of the Art in Ray Tracing Animated Scenes

19 th INTERNATIONAL CONGRESS ON ACOUSTICS MADRID, 2-7 SEPTEMBER 2007

On fast Construction of SAH-based Bounding Volume Hierarchies

Dual-Split Trees Supplemental Materials

Kinetic BV Hierarchies and Collision Detection

Automatic Creation of Object Hierarchies for Ray Tracing of Dynamic Scenes

Specialized Acceleration Structures for Ray-Tracing. Warren Hunt

Ray Casting Deformable Models on the GPU

Collision Detection. Motivation - Dynamic Simulation ETH Zurich. Motivation - Path Planning ETH Zurich. Motivation - Biomedical Simulation ETH Zurich

Enhancing Visual Rendering on Multicore Accelerators with Explicitly Managed Memories *

Efficient Clustered BVH Update Algorithm for Highly-Dynamic Models. Kirill Garanzha

Dynamic Spatial Partitioning for Real-Time Visibility Determination. Joshua Shagam Computer Science

Parallel Path Tracing using Incoherent Path-Atom Binning

Ray Tracing Acceleration Data Structures

Stackless Ray Traversal for kd-trees with Sparse Boxes

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

Simulation in Computer Graphics Space Subdivision. Matthias Teschner

T-SAH: Animation Optimized Bounding Volume Hierarchies

Deep Coherent Ray Tracing

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

Transcription:

t min X X Y 1 B C Y 1 Y 2 A Y 2 D A B C D t max

t min X X Y 1 B C Y 2 Y 1 Y 2 A Y 2 D A B C D t max

t min X X Y 1 B C Y 1 Y 2 A Y 2 D A B C D t max

t min A large tree structure change. A totally new tree! Y Y?????? t max

Solution 1: Rebuild kd-tree each frame Rebuild kd-tree in a lazy manner, approximate SAH (Surface Area Heuristics) [Hunt et al. 06] Can just move objects bounding boxes around and transform rays (for hierarchical movement) [Wald et al. 03] Motion decomposition, fuzzy kd-trees [Günther et al. 06] Solution 2: use different hierarchical structure

Bounding volume hierarchies (BVHs) [Wald et al. 06b, Boulos et al. 06, Lauterbach et al. 06] Grids [Wald et al. 06a]

Ray Tracing Dynamic Scenes Using BVHs [Lauterbach et al. 06] Dinesh Manocha, Christian Lauterbach University of North Carolina at Chapel Hill

Tree of bounding volumes (sphere, AABB, OBB, k -DOP, spherical shells, etc.) Each bounding volume encloses nearby primitives Parent node primitives are union of children node primitives

Spatial partitioning: space is subdivided into disjoint regions (e.g. grid, kd-tree, octree,...) Object hierarchy: groups or clusters of objects/primitives are subdivided (BVH, s-kd-tree)

Implications for ray tracing Spatial partitioning: Objects referenced in multiple nodes (overlap in object space) BVH Hierarchies: Nodes can overlap each other (overlap in 3D space) Spatial partitioning allows easier front-to -back ordering

Widely used for intersection computations Ray tracing Visibility culling: view frustum and occlusion culling Collision and proximity computations Other applications

Pretty simple: Start from root If ray intersects AABB, try all children, too: is inner node: recurse on both children is leaf node: intersect with primitive(s) Naïve implementation far slower than kd-tree!

Intersection test more costly Up to 6 ray-plane intersections for AABB (slabs test) Just 1 for kd-tree No front-to-back ordering Cannot stop after finding first hit Nodes take more space 32 bytes vs. 8 bytes

AABBs can provide tighter fit automatically No empty leafs, tree does not need to be as deep Primitives only referenced once less nodes in hierarchy #nodes known in advance (2n-1) (if 1 primitive/leaf)

AABBs can provide tighter fit automatically No empty leafs, tree does not need to be as deep Primitives only referenced once less nodes in hierarchy #nodes known in advance (2n-1) (if 1 primitive/leaf) Can be updated easily!

What does updating mean? Underlying geometry changes Update will ensure correctness of hierarchy without rebuilding it Should be faster than rebuild

Post-order traversal of BVH Update children's AABB, then update own At leaf level, update from primitives Also update additional information such as axis O(n) time Usually a few ms for small scenes May become too long for large models!

Quality of BVH may decrease over animation Update does not change tree topology Rebuild may be necessary How to detect? In worst-case scene: Performance dropping an order of magnitude over 20 animation frames Not as bad for normal scenes, though

Use heuristic to detect degradation Assume performance lower when BVHs contain lots of empty space:

How to measure quality? Use ratio of surface area parent to children SA(parent) / ( SA(child1) + SA(child2) ) Save on rebuild for each node (4 bytes/node) On each update: compare to initial value Sum up differences and normalize If above threshold: initiate rebuild ~30-40% work well in practice

Video

Ray Tracing Animated Scenes using Coherent Grid Traversal [Wald et al. 06a] I Wald, T Ize, A Kensler, A Knoll, S Parker SCI Institute, University of Utah

A new traversal techniques for uniform grids that makes packet/frustum traversal compatible with grids thus achieves performance competitive with fastest kd-trees and which allows for per-frame rebuilds (dynamic scenes)

Since 70 ies: Lots of different RT data structures

Since 70 ies: Lots of different RT data structures BVH

Since 70 ies: Lots of different RT data structures BVH

Since 70 ies: Lots of different RT data structures BVH

Since 70 ies: Lots of different RT data structures BVH Octree

Since 70 ies: Lots of different RT data structures BVH Octree

Since 70 ies: Lots of different RT data structures BVH Octree

Since 70 ies: Lots of different RT data structures BVH Octree

Since 70 ies: Lots of different RT data structures BVH Octree Grid

Since 70 ies: Lots of different RT data structures BVH Octree Grid

Since 70 ies: Lots of different RT data structures BVH Octree Grid

Since 70 ies: Lots of different RT data structures BVH Octree Grid

Since 70 ies: Lots of different RT data structures BVH Octree Grid Kd-tree

Since 70 ies: Lots of different RT data structures BVH Octree Grid Kd-tree

Since 70 ies: Lots of different RT data structures BVH Octree Grid Kd-tree

Since 70 ies: Lots of different RT data structures BVH Octree Grid Kd-tree

Since 70 ies: Lots of different RT data structures BVH Octree Grid Kd-tree Of all these, grid is only that is not hierarchical!

Grid is not hierarchical Much simpler to build (similar to 3D -rasterization, very fast) Build-times in the paper: 2.2M Soda Hall in 110 ms Ideally suited for handling dynamic scenes Full rebuild every frame, no restrictions at all!

All of the recent advancements of RT are for kd -trees! Pre-2000: Tie between grids and kd-trees [Wald 01]: New concept coherent ray tracing (for kd -tree) Trace packets of coherent rays 10x faster than single rays [Woop 05]: First RT hardware prototype RPU (for kd-tree) [Reshetov 05]: New concept multilevel ray tracing (kd -tree) Trace packets using bounding frusta another 10x faster than CRT! But: (good) kd-trees are (too) costly to build

SIGGRAPH 05: Dynamic Scenes huge problem Ray tracing has become very fast (MLRT: ~100fps) If ray tracing is to ever replace rasterization, it must support dynamic scenes (games ) But: All our fast RT algos are for kd-trees and kd-trees can t do dynamic scenes

SIGGRAPH 05: Dynamic Scenes huge problem Since then, lots of research Lazy kd-tree construction (Razor [Stoll, Mark 06]) Fast BVH and kd-tree construction (yet unpublished) Motion decomposition [Günther et al. 06] Dynamic BVHs [Wald et al. 06, Lauterbach et al. 06] Hybrid BVH/kd-trees [Woop 06, Havran 06, Wachter 06, ] Coherent Grid Traversal [Wald et al. 06]

2005: Grid too slow to traverse (vs kd-tree) Fact: Fast RT needs packets & frusta concepts Traverse multiple packets over same node of DS Rather simple for hierarchical data structures Test both children in turn for overlap w/ packet If child overlaps: traverse it, else: skip it. (it s as simple as that) but not for grids

Packets & grids: Non-trivial task In which order to test the nodes? ABCD or ABDC? What to do when packet diverges? 3DDDA etc break in that case Split diverging packet? Quickly degenerates to single-ray traversal Fix by re-merging packets? Non-trivial & costly

First: Transform all rays into canonical grid space i.e., [0,0,0]-[Nx,Ny,Nz]

Idea: Consider only frustum, not set of rays

Idea: Consider only frustum, not set of rays

Idea: Consider only frustum, not set of rays Traverse slice by slice instead of cell to cell Pick major traversal axis (e.g., max component of 1st ray)

Idea: Consider only frustum, not set of rays Traverse slice by slice instead of cell to cell

Idea: Consider only frustum, not set of rays Traverse slice by slice instead of cell to cell

Idea: Consider only frustum, not set of rays Traverse slice by slice instead of cell to cell

Idea: Consider only frustum, not set of rays Traverse slice by slice instead of cell to cell

Idea: Consider only frustum, not set of rays Traverse slice by slice instead of cell to cell For each slice, compute frustum/slice overlap

Idea: Consider only frustum, not set of rays Traverse slice by slice instead of cell to cell For each slice, compute frustum/slice overlap

Idea: Consider only frustum, not set of rays Traverse slice by slice instead of cell to cell For each slice, compute frustum/slice overlap Float-to-int gives overlapped cell IDs

Idea: Consider only frustum, not set of rays Traverse slice by slice instead of cell to cell For each slice, compute frustum/slice overlap Float-to-int gives overlapped cell IDs Intersect all cells in given slice

Idea: Consider only frustum, not set of rays Traverse slice by slice instead of cell to cell For each slice, compute frustum/slice overlap Float-to-int gives overlapped cell IDs Intersect all cells in given slice Loop: incrementally compute next slice s overlap box 4 additions

Idea: Consider only frustum, not set of rays Traverse slice by slice instead of cell to cell For each slice, compute frustum/slice overlap Float-to-int gives overlapped cell IDs Intersect all cells in given slice Loop: incrementally compute next slice s overlap box 4 additions

Expensive setup phase Transform rays to canonical grid coordinate system Determine major march direction (simple) Compute min/max bounding planes (slopes and offsets) Compute first and last slice to be traversed (full frustum clip) But: Very simple traversal step Overlap box update: 4 float additions (1 SIMD instruction) Get cell IDs: 4 float-to-int truncations (SIMD ) Loop over overlapped cells (avg: 1.5-2 cells per slice)

Grid usually less efficient than kd-tree

Grid usually less efficient than kd-tree Cannot adapt to geometry as well more intersections

Grid usually less efficient than kd-tree Cannot adapt to geometry as well more intersections Tris straddle many cells re-intersection

Grid usually less efficient than kd-tree Cannot adapt to geometry as well more intersections Tris straddle many cells re-intersection First sight: Frustum makes it worse

Grid usually less efficient than kd-tree Cannot adapt to geometry as well more intersections Tris straddle many cells re-intersection First sight: Frustum makes it worse Rays isec tris outside their cells

Grid usually less efficient than kd-tree Cannot adapt to geometry as well more intersections Tris straddle many cells re-intersection First sight: Frustum makes it worse Rays isec tris outside their cells Re-isec aggravated by width of frustum

Grid usually less efficient than kd-tree First sight: Frustum makes it worse But: Two easy fixes

Grid usually less efficient than kd-tree First sight: Frustum makes it worse But: Two easy fixes Bad culling SIMD Frustum culling in Outside frustum cull! Packet/Tri Isec [Dmitriev et al.]

Grid usually less efficient than kd-tree First sight: Frustum makes it worse But: Two easy fixes Bad culling SIMD Frustum culling in Packet/Tri Isec [Dmitriev et al.] Re-intersection: Mailboxing [Haines] Mailbox detects re-intersection

Surprise: Mailboxing & Frustum culling very effective Both standard techniques, both limited success for kd-trees Grid & Frustum: Exactly counter weak points of CGT Hand Grid w/o FC & MB : 14 M ray-tri isecs Grid with FC & MB:.9 M ray-tri isecs (14x less) Kd-tree :.85M ray-tri isecs (5% less than grid) And: cost indep of #rays very cheap (amortize)

Comparison to single-ray grid Fast single-ray traverser, macrocell if advantageous, Speedup 6.5x to 20.9x, usually ~10x Comparison to kd-tree To OpenRT: 2x-8x faster (2M Soda Hall: 4.5x) To MLRT: ~3x slower (but much less optimized) Tests performed on kd-tree friendly models

Acceleration Structure for Animated Scenes Build time: Usually affordable even on single CPU Traversal results (1024^2, dual 3.2 GHz Xeon PC) X/Y: X=raycast only; Y=raytrace+shade+texture+shadows Hand Poser 16K triangles 34.5/15.3 fps 78K triangles 15.8/7.8 fps Toys Marbles Fairy 11K triangles 29.3/10.2 fps 8.8K triangles 57.1/26.2 fps 174K triangles 3.4/1.2 fps

Comparison to state-of-the-art BVH or kd-tree Somewhat harder to code and get right than, e.g., BVH Usually somewhat slower (~1.5x-3x) More susceptible to incoherence & teapot-in-stadium cases Pure frustum tech.: Visits all cells in frustum even if not touched by any ray! BUT: It works at all! (Who d have thought 12m ago?) ~10x faster than single-ray grid Benefits better from additional coherence (4x AA at 2x cost) Maybe better suited for regular data or special HW (Cell, GPUs) Most flexible wrt dynamic no limitation at all

Have developed a new technique that Makes grid compatible with packets & frusta Is competitive with BVHs and kd-trees Most general in handling dynamic scenes

[Boulos et al. 06]: Solomon Boulos, Dave Edwards, J Dylan Lacewell, Joe Kniss, Jan Kautz, Peter Shirley, and Ingo Wald. Interactive Distribution Ray Tracing. Technical Report, SCI Institute, University of Utah, No UUSCI-2006-022, 2006. [Günther et al. 06]:Johannes Günther, Heiko Friedrich, Ingo Wald, Hans-Peter Seidel, and Philipp Slusallek. Ray tracing animated scenes using motion decomposition. Computer Graphics Forum, 25(3), September 2006 (to appear) [Havran et al. 06]: Vlastimil Havran, Robert Herzog, and Hans-Peter Seidel. On Fast Construction of Spatial Hierarchies for Ray Tracing. Submitted to RT 06, 2006. [Lauterbach et al. 06]: Christian Lauterbach, Sung-Eui Yoon, David Tuft, Dinesh Manocha. RT-DEFORM: Interactive Ray Tracing of Dynamic Scenes using BVHs. Technical Report TR06-10, University of North Carolina at Chapel Hill, 2006. [Mahovsky and Wyvill 04]: Jeffrey Mahovsky, Brian Wyvill. Fast Ray-axis Aligned Bounding Box Overlap Tests with Plücker Coordinates. Journal of Graphics Tools, 9(1):35-46, 2004 [Reshetov et al. 05]: Alexander Reshetov, Alexei Soupikov, and Jim Hurley. Multi-level ray tracing algorithm. ACM Trans. Graph., 24(3) :1176 1185, 2005. [Rubin and Whitted 80]: Steven M. Rubin and Turner Whitted. A 3-dimensional representation for fast rendering of complex scenes. Computer Graphics, 14(3):110 116, July 1980. [Smits98]: Brian Smits. Efficiency issues for ray tracing. Journal of Graphics Tools: JGT, 3(2):1 14, 1998. [Wächter and Keller 06]: Carsten Wächter and Andreas Keller. Instant Ray Tracing: The Bounding Interval Hierarchy. Rendering Techniques 2006: Eurographics Symposium on Rendering, 2006. [Wald et al. 03]: Ingo Wald, Carsten Benthin, and Philipp Slusallek. Distributed Interactive Ray Tracing of Dynamic Scenes. In Proceedings of the IEEE Symposium on Parallel and Large-Data Visualization and Graphics (PVG), 2003. [Wald et al. 06a]:Ingo Wald, Thiago Ize, Andrew Kensler, Aaron Knoll, and Steven Parker. Ray Tracing Animated Scenes using Coherent Grid Traversal. In ACM Transaction on Graphics (Proc. SIGGRAPH 2006). [Wald et al. 06b]: Ingo Wald, Solomon Boulos, and Peter Shirley. Ray Tracing Deformable Scenes using Dynamic Bounding Volume Hierarchies. Technical Report, SCI Institute, University of Utah, No UUSCI-2005-014 (conditionally accepted at ACM Transactions on Graphics), 2006. [Woop et al. 06]: Sven Woop, Gerd Marmitt, and Philipp Slusallek. B-KD Trees for Hardware Accelerated Ray Tracing of Dynamic Scenes. In Proceedings of Graphics Hardware (to appear), 2006. [Hunt et al. 06]: Warren Hunt, William R. Mark and Gordon Stoll, Fast kd-tree Construction with an Adaptive Error-Bounded Heuristic 2006 IEEE Symposium on Interactive Ray Tracing.