19 th Eurographics Symposium on Rendering Compact Fast

  • Slides: 37
Download presentation
19 th Eurographics Symposium on Rendering Compact, Fast and Robust Grids for Ray Tracing

19 th Eurographics Symposium on Rendering Compact, Fast and Robust Grids for Ray Tracing Ares Lagae & Philip Dutré EGSR 2008 Wednesday, June 25 th

Introduction • Acceleration structures for ray tracing – Kd-tree, BVH, … • Build time:

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

Introduction • Algorithms in general – CPU-bound • Execution time = f( CPU speed

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

Grid Data Structures • Grid and linearized grid 0 ariz e 2 D 0

Grid Data Structures • Grid and linearized grid 0 ariz e 2 D 0 1 2 2 0 line 1 2 0 1 D 1 1 2 3 4 5 6 7 8

Grid Data Structures • Data structure using linked lists 0 1 2 3 4

Grid Data Structures • Data structure using linked lists 0 1 2 3 4 5 6 7 8 1 1 0 2 2 1 1 • 1 word / cell • 2/3 words / object reference 0

Grid Data Structures • Data structure using dynamic arrays 0 2 1 0 2

Grid Data Structures • Data structure using dynamic arrays 0 2 1 0 2 2 1 3 1 2 1 4 0 5 3 2 6 2 2 0 1 1 2 7 1 2 0 8 1 2 2 • 3 words / cell • 1 -2 words / object reference : unused space

Compact Grid • Data structure – Concatenate object lists, store begin index 0 1

Compact Grid • Data structure – Concatenate object lists, store begin index 0 1 2 3 4 5 6 7 8 0 0 1 2 3 6 8 9 10 11 1 1 0 0 1 2 0 2 2 0 1 2 3 4 5 6 7 8 9 10 1 word / cell, 1 word / object reference 11

Compact Grid • Build algorithm (Bound – Count – Accumulate – Insert) 1. Bound

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

Compact Grid • Build algorithm (Bound – Count – Accumulate – Insert) 2. Count

Compact Grid • Build algorithm (Bound – Count – Accumulate – Insert) 2. Count Compute size of object lists (1 st pass) 0 1 2 3 4 5 6 7 8 0 1 1 1 3 2 1 1 1 0 1 2 3 4 5 6 7 8 9 10 11

Compact Grid • Build algorithm (Bound – Count – Accumulate – Insert) 3. Accumulate

Compact Grid • Build algorithm (Bound – Count – Accumulate – Insert) 3. Accumulate Compute indices of object lists 0 1 2 3 4 5 6 7 8 0 1 2 3 6 8 9 10 11 0 1 2 3 4 5 6 7 8 9 10 11

Compact Grid • Build algorithm (Bound – Count – Accumulate – Insert) 4. Insert

Compact Grid • Build algorithm (Bound – Count – Accumulate – Insert) 4. Insert Reversely insert the object references (2 nd pass) 0 1 2 3 4 5 6 7 8 0 0 1 2 3 6 8 9 10 1 1 0 0 1 2 0 2 2 0 1 2 3 4 5 6 7 8 9 10 11

Compact Grid • Build algorithm – Time complexity Linear in the number of objects

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

Hashed Grid • Reduce memory footprint even further – Fast build algorithm – Efficient

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

Hashed Grid • Row displacement compression C 1 5 11 12 15

Hashed Grid • Row displacement compression C 1 5 11 12 15

Hashed Grid • Row displacement compression C O 1 5 11 12 15 H

Hashed Grid • Row displacement compression C O 1 5 11 12 15 H

Hashed Grid • Row displacement compression C O 1 0 1 5 11 12

Hashed Grid • Row displacement compression C O 1 0 1 5 11 12 15 H 1

Hashed Grid • Row displacement compression C O 1 0 5 1 1 5

Hashed Grid • Row displacement compression C O 1 0 5 1 1 5 11 12 15 H 1 5

Hashed Grid • Row displacement compression C O 1 0 5 1 11 12

Hashed Grid • Row displacement compression C O 1 0 5 1 11 12 1 5 1 11 15 H 1 5 11

Hashed Grid • Row displacement compression C 12 O 1 0 5 1 11

Hashed Grid • Row displacement compression C 12 O 1 0 5 1 11 1 15 3 1 5 11 H 1 5 12 11 15

Hashed Grid • Row displacement compression O 0 1 1 3 C[i, j] H[O[i]

Hashed Grid • Row displacement compression O 0 1 1 3 C[i, j] H[O[i] + j] H 1 5 12 11 15

Hashed Grid • Row displacement compression D O 0 1 1 3 |D| +

Hashed Grid • Row displacement compression D O 0 1 1 3 |D| + |O| + |H| << |C| H 1 5 12 11 15

Hashed Grid • Build algorithm – – – Bound Compute domain bits Compute hash

Hashed Grid • Build algorithm – – – Bound Compute domain bits Compute hash function Count Accumulate Insert • Time complexity:

Results • Comparison traditional grid data structures Memory usage Build time

Results • Comparison traditional grid data structures Memory usage Build time

Results • Hashed grid Cruiser • Scene: 3. 64 M triangles, 124. 84 MB

Results • Hashed grid 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 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

Applications • Interactive ray tracing of dynamic scenes Scene: 260 K triangles - FPS:

Applications • Interactive ray tracing of dynamic scenes Scene: 260 K triangles - FPS: 8. 38 FPS (512 x 512)

Applications St. Matthew David • Ray tracing large models • Scene: 56. 23 M

Applications St. Matthew David • Ray tracing large models • 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 • Scene: 372. 77 M triangles, 12. 50 GB • Time to image: - / 60. 75 s • Memory usage: - / 2. 36 GB

Conclusion & Future Work • Conclusion – Compact grid method Optimal grid representation (1

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

Thanks! • Questions? Acknowledgments Ares Lagae is a Postdoctoral Fellow of the Research Foundation

Thanks! • Questions? Acknowledgments Ares Lagae is a Postdoctoral Fellow of the Research Foundation Flanders (FWO) The Stanford 3 D Scanning Repository, The Digital Michelangelo Project, the bwfirt benchmark, Matthias Rolf, Bernhard Finkbeiner and Greg Ward

Robust Grid Traversal • Discard intersections outside of cell Not robust {} {…}

Robust Grid Traversal • Discard intersections outside of cell Not robust {} {…}

Robust Grid Traversal • Discard intersections outside of cell Not robust Regular grid traversal

Robust Grid Traversal • Discard intersections outside of cell Not robust Regular grid traversal

Robust Grid Traversal Do not discard intersections outside of cell – Keep closest intersection,

Robust Grid Traversal Do not discard intersections outside of cell – Keep closest intersection, terminate after the intersection Regular grid traversal Robust grid traversal

Parallelization • Using sort-middle approach of Ize et al. Asian Dragon Nature

Parallelization • Using sort-middle approach of Ize et al. Asian Dragon Nature

Results • Comparison traditional grid data structures Memory usage Build time

Results • Comparison traditional grid data structures Memory usage Build time

Parallelization • Using sort-middle approach of Ize et al. Asian Dragon Nature

Parallelization • Using sort-middle approach of Ize et al. Asian Dragon Nature

Hashed Grid • Row displacement compression C 12 O 1 0 5 1 11

Hashed Grid • Row displacement compression C 12 O 1 0 5 1 11 1 15 3 C[i, j] H[O[i] + j] 1 5 11 H 1 5 12 11 15