Download presentation
Presentation is loading. Please wait.
Published byDale Joseph Modified over 9 years ago
1
Compact, Fast and Robust Grids for Ray Tracing Ares Lagae & Philip Dutré 19 th Eurographics Symposium on Rendering EGSR 2008Wednesday, June 25th
2
Introduction Acceleration structures for ray tracing –Kd-tree, BVH, … Build time: slower (super-linear) Render time: faster –Grid Build time: faster (linear) Render time: slower Minimize time to image –Time to image = render time + build time –Especially for dynamic scenes
3
Introduction Algorithms in general –CPU-bound Execution time = f( CPU speed ) –Memory-bound Execution time = f( memory speed ) Accelerate by decreasing memory footprint Minimize memory footprint –Especially for large models
4
Grid Data Structures Grid and linearized grid 2 1 0 012 012345678 2D 1D linearize 0 1 2
5
Grid Data Structures Data structure using linked lists 012345678 1102 1 0 2022 1 1 word / cell 2/3 words / object reference
6
Grid Data Structures Data structure using dynamic arrays 012345678 1100 1 2 1 2 022 202121214322212121 3 words / cell 1-2 words / object reference : unused space
7
Compact Grid Data structure –Concatenate object lists, store begin index 001268910 012345678 11 1100112022 01234567891011 1 word / cell, 1 word / object reference 3 2
8
Compact Grid Build algorithm (Bound – Count – Accumulate – Insert) 1. Bound Compute bounding box of objects Determine grid resolution Grid size linear in number of objects
9
Compact Grid Build algorithm (Bound – Count – Accumulate – Insert) 2. Count Compute size of object lists (1 st pass) 01112111 012345678 01234567891011 3
10
Compact Grid Build algorithm (Bound – Count – Accumulate – Insert) 3. Accumulate Compute indices of object lists 0123891011 012345678 01234567891011 6
11
Compact Grid Build algorithm (Bound – Count – Accumulate – Insert) 4. Insert Reversely insert the object references (2 nd pass) 001268910 012345678 1100112022 0123456789 11 2 3
12
Compact Grid Build algorithm –Time complexity Linear in the number of objects –Space complexity Linear in the number of objects Traversal algorithm –Any grid traversal algorithm
13
Hashed Grid Reduce memory footprint even further –Fast build algorithm –Efficient access during traversal Redundancy –Object lists? no Experiments with object list compression failed –Cells? yes Grid is sparse, up to 99% of the cells are empty
14
Hashed Grid Row displacement compression 1 5 11 1215 C
15
Hashed Grid Row displacement compression 1 5 11 1215 CO H
16
Hashed Grid Row displacement compression 1 5 11 1215 1 1 CO H 0
17
Hashed Grid Row displacement compression 1 5 11 1215 1 5 15 CO H 0 1
18
Hashed Grid Row displacement compression 1 5 11 1215 1 5 11 15 CO H 0 1 1
19
Hashed Grid Row displacement compression 1 5 11 1215 1 5 11 1215 12111515 CO H 0 1 1 3
20
Hashed Grid Row displacement compression 12111515 O H C[i,j] H[O[i] + j] 0 1 1 3
21
Hashed Grid Row displacement compression 12111515 DO H |D| + |O| + |H| << |C| 0 1 1 3
22
Hashed Grid Build algorithm –Bound –Compute domain bits –Compute hash function –Count –Accumulate –Insert Time complexity:
23
Results Comparison traditional grid data structures Memory usageBuild time
24
Results Hashed grid Thai Statue Scene: 28.06 M triangles, 343.32 MB Memory object lists: 69.78 MB Memory cells: 152.75 MB 8.97 MB Build time: 1.17 s 1.76 s Render time: 1.55 s 1.43 s Cruiser Scene: 3.64 M triangles, 124.84 MB Memory object lists: 28.84 MB Memory cells: 55.48 MB 6.20 MB Build time: 0.39 s 0.72 s Render time: 2.49 s 2.52 s
25
Applications Interactive ray tracing of dynamic scenes Scene: 260 K triangles - FPS: 8.38 FPS (512 x 512)
26
Applications Ray tracing large models St. Matthew Scene: 372.77 M triangles, 12.50 GB Time to image: - / 60.75 s Memory usage: - / 2.36 GB David Scene: 56.23 M triangles, 1.89 GB Time to image: 7.55 s / 10.21 s Memory usage: 1.17 GB / 379.94 MB
27
Conclusion & Future Work Conclusion –Compact grid method Optimal grid representation (1 word / cell, 1 word / object reference) –Hashed grid method Applied perfect spatial hashing to grids for ray tracing Future Work –Extend to hierarchical grids –Extend to other acceleration structures
28
Thanks! Questions? Acknowledgments Ares Lagae is a Postdoctoral Fellow of the Research Foundation Flanders (FWO) The Stanford 3D Scanning Repository, The Digital Michelangelo Project, the bwfirt benchmark, Matthias Rolf, Bernhard Finkbeiner and Greg Ward
30
Robust Grid Traversal Discard intersections outside of cell Not robust {} {…}
31
Robust Grid Traversal Discard intersections outside of cell Not robust Regular grid traversal
32
Robust Grid Traversal Do not discard intersections outside of cell –Keep closest intersection, terminate after the intersection Regular grid traversalRobust grid traversal
33
Parallelization Using sort-middle approach of Ize et al. Asian DragonNature
35
Results Comparison traditional grid data structures Memory usageBuild time
36
Parallelization Using sort-middle approach of Ize et al. Asian DragonNature
37
Hashed Grid Row displacement compression 1 5 11 1215 1 5 11 1215 12111515 CO H C[i,j] H[O[i] + j] 0 1 1 3
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.