Title: Ray Tracing Animated Scenes using Coherent Grid Traversal
1Ray Tracing Animated Scenes using Coherent Grid
Traversal
- Ingo Wald Thiago Ize Andrew
Kensler - Aaron Knoll Steven G. Parker
- SCI Institute, University of Utah
SIGGRAPH 2006
2Abstract
- A new traversal techniques for uniform grids
- Achieves performance competitive with the fastest
unknown kd-tree based ray tracer - allows for per-frame rebuilds (dynamic scenes)
3Outline
- Introduction
- Related Work
- Coherent Grid Traversal
- Experiments and Results
- Conclusion and Future Work
4Introduction
5Whats so special about grids?
- Since 70ies Lots of different RT data structures
6Whats so special about grids?
- Since 70ies Lots of different RT data structures
BVH
7Whats so special about grids?
- Since 70ies Lots of different RT data structures
BVH
8Whats so special about grids?
- Since 70ies Lots of different RT data structures
BVH
9Whats so special about grids?
- Since 70ies Lots of different RT data structures
Octree
BVH
10Whats so special about grids?
- Since 70ies Lots of different RT data structures
Octree
BVH
11Whats so special about grids?
- Since 70ies Lots of different RT data structures
Octree
BVH
12Whats so special about grids?
- Since 70ies Lots of different RT data structures
Octree
BVH
13Whats so special about grids?
- Since 70ies Lots of different RT data structures
Octree
BVH
Grid
14Whats so special about grids?
- Since 70ies Lots of different RT data structures
Octree
BVH
Grid
15Whats so special about grids?
- Since 70ies Lots of different RT data structures
Octree
BVH
Grid
16Whats so special about grids?
- Since 70ies Lots of different RT data structures
Octree
BVH
Grid
Kd-tree
17Whats so special about grids?
- Since 70ies Lots of different RT data structures
Octree
BVH
Grid
Kd-tree
18Whats so special about grids?
- Since 70ies Lots of different RT data structures
Octree
BVH
Grid
Kd-tree
19Whats so special about grids?
- Since 70ies Lots of different RT data structures
Octree
BVH
Grid
Kd-tree
20Whats so special about grids?
- Since 70ies Lots of different RT data structures
Octree
BVH
Grid
Kd-tree
? Of all these, grid is only that is not
hierarchical !
21Whats so special about grids?
- Grid is not hierarchical
- ? Much simpler to build
- 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 !
22Related Work
23Related Work
- All of the recent advancements of RT are for
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 frustum ? another
10x faster than CRT ! - But kd-trees are too costly to build
24Related Work
- 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 cant do dynamic scenes
25Coherent Grid Traversal
26Coherent Grid Traversal
- Grid too slow to traverse (vs kd-tree).
- Deliver to grids the same components that made
kd-tree as fast as they are today - Packets
- SIMD
- Frustum traversal
27Issues with Packetized Grids
- Grid based ray tracers typically use 3D digital
differential analyzers (3DDDA) to iterate through
the voxels traversed by the ray. - Chose only one cell at a time
- In which order to test the nodes ?
- ABCD or ABDC ?
- Split diverging packet ?
- Quickly degenerates to single-raytraversal
- Fix by re-merging packets ?
- Expensive cost
28A Slice-based Packet Traversal for Grids
- First Transform all rays into the canonical grid
coordinate system - i.e., 0,0,0-Nx,Ny,Nz
29A Slice-based Packet Traversal for Grids
- Pick the dominant component (the X, Y, Z axis)
of the direction of the first ray. - Major traversal axis
K
30A Slice-based Packet Traversal for Grids
- Idea Consider only frustum, not set of rays
K
31A Slice-based Packet Traversal for Grids
- Idea Consider only frustum, not set of rays
K
32A Slice-based Packet Traversal for Grids
- Idea Consider only frustum, not set of rays
- Traverse slice by slice instead of cell to
cell
K
33A Slice-based Packet Traversal for Grids
- Idea Consider only frustum, not set of rays
- Traverse slice by slice instead of cell to
cell
K
1
34A Slice-based Packet Traversal for Grids
- Idea Consider only frustum, not set of rays
- Traverse slice by slice instead of cell to
cell
K
1
2
35A Slice-based Packet Traversal for Grids
- Idea Consider only frustum, not set of rays
- Traverse slice by slice instead of cell to
cell
K
1
2
3
36A Slice-based Packet Traversal for Grids
- Idea Consider only frustum, not set of rays
- Traverse slice by slice instead of cell to
cell
K
1
2
3
4
37A Slice-based Packet Traversal for Grids
- Idea Consider only frustum, not set of rays
- Traverse slice by slice instead of cell to
cell - For each slice, compute frustum/slice overlap
38A Slice-based Packet Traversal for Grids
- Idea Consider only frustum, not set of rays
- Traverse slice by slice instead of cell to
cell - For each slice, compute frustum/slice overlap
K
U
V
39A Slice-based Packet Traversal for Grids
- Idea Consider only frustum, not set of rays
- Traverse slice by slice instead of cell to
cell - For each slice, compute frustum/slice overlap
- One SIMD float-to-int truncation gives overlapped
cell
40A Slice-based Packet Traversal for Grids
- Idea Consider only frustum, not set of rays
- Traverse slice by slice instead of cell to
cell - For each slice, compute frustum/slice overlap
- One SIMD float-to-int truncation gives overlapped
cell - Intersect all cells in given slice
41A Slice-based Packet Traversal for Grids
- Idea Consider only frustum, not set of rays
- Traverse slice by slice instead of cell to
cell - For each slice, compute frustum/slice overlap
- One SIMD float-to-int truncation gives overlapped
cell - Intersect all cells in given slice
- Loop incrementally compute nextslices overlap
box - One four-float SIMD addition
42A Slice-based Packet Traversal for Grids
- The whole process of computing the next slices
overlapped cell coordinates costs only two
instructions - One four-float SIMD addition
- One SIMD float-to-int truncation
43Coherent Grid Traversal
- Grid usually less efficient than kd-tree
44Coherent Grid Traversal
- Grid usually less efficient than kd-tree
- Cannot adapt to geometry as well ? more
intersections test
Kd-tree
grid
45Coherent Grid Traversal
- Grid usually less efficient than kd-tree
- Cannot adapt to geometry as well ? more
intersections test - Triangles straddle many cells ? re-intersection
46Coherent Grid Traversal
- The overhead of these additional tests can be
avoided using two well-known techniques - SIMD Frustum Culling Dmitriev et al. 2004
- A SIMD 4-ray-triangle intersection test
Outside frustum ? cull
47Coherent Grid Traversal
- The overhead of these additional tests can be
avoided using two well-known techniques - SIMD Frustum Culling Dmitriev et al. 2004
- Mailboxing Kirk and Arvo 1991
- Each packet is assigned a unique ID
- A triangle is tagged with that ID
- before the intersection test
- If a packet visits a triangle already
- tagged with its ID ? Skip
Mailbox detectsre-intersection
48Impact of Mailboxing and Frustum Culling
- Compare with OpenRTs kd-tree system
- Mailboxing reduces tests by up to a factor of 2
- Frustum culling reduces tests by a factor of 4 to
9
49Experiments and Results
50Impact of Packet Resolution
Best is 4x4 (green) or 8x8 (blue)
51Performance for Static Scenes
- Compare to kd-tree
- To OpenRT 2x-8x faster
- To MLRT 3x slower
- Tests performed on kd-tree friendly models
52Comparison to Single-Ray Grid Traversal
- Compare to an optimized single-ray 3DDDA
implementation of a hierarchical grid - Speedup 6.5x to 20.9x, usually 10x
53Result
- Platform 10242, dual 3.2 GHz Xeon PC
- X/Y
- Xraycast only
- Yraytraceshadetextureshadows
Poser78K triangles15.8/7.8 fps
Hand16K triangles34.5/15.3 fps
Fairy174K triangles3.4/1.2 fps
Marbles8.8K triangles57.1/26.2 fps
Toys11K triangles29.3/10.2 fps
54Conclusion and Future Work
55Conclusion
- 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
- Future Work
- Hybrid approaches
- E.g., a kd-tree for static content and one
separate grid for each animated character