Presentation is loading. Please wait.

Presentation is loading. Please wait.

Compact, Fast and Robust Grids for Ray Tracing

Similar presentations


Presentation on theme: "Compact, Fast and Robust Grids for Ray Tracing"— Presentation transcript:

1 Compact, Fast and Robust Grids for Ray Tracing
Ares Lagae & Philip Dutré Katholieke Universiteit Leuven Wednesday, 13 August

2 Contributions Two memory-efficient representations for grids for ray tracing 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 Simple and efficient 1

3 slower (super-linear)
Motivation Acceleration structures for ray tracing Kd-tree, BVH, … Grid Build time slower (super-linear) faster (linear) Render time faster slower 2  Minimize time to image Time to image = build time + render time Especially for dynamic scenes

4 Motivation Algorithms in general  Minimize memory footprint CPU-bound
Execution time = f( CPU speed ) Memory-bound Execution time = f( memory access speed )  Accelerate by decreasing memory footprint  Minimize memory footprint Especially for large models 3

5 Grid Data Structures Grid and linearized grid 1 2 1 2 2D 2D 2 1 C A
1 2 1 2 2D 2D 2 1 C A linearize B 4 1 2 3 4 5 6 7 8 1D

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

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

8 Compact Grid Data structure
Concatenate object lists, store begin index 1 2 3 4 4 4 5 6 7 8 1 2 3 3 3 3 3 3 3 6 8 9 10 11 7 B B A A B C B C A C C 1 2 3 3 3 3 3 4 4 4 4 5 5 5 6 7 8 9 10 11  1 word / cell, 1 word / object reference

9 Compact Grid Build algorithm (Bound – Count – Accumulate – Insert)
 Compute bounding box of objects  Determine grid resolution 8  Grid size linear in number of objects

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

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

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

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

14 Compact Grid Build algorithm (Bound – Count – Accumulate – Insert)
 Reversely insert the object references (2nd pass) 1 2 3 4 5 6 7 8 1 2 3 3 3 3 8 9 10 11 11 A B C 1 2 3 4 5 6 7 8 9 10 11

15 Compact Grid Build algorithm (Bound – Count – Accumulate – Insert)
 Reversely insert the object references (2nd pass) 1 2 3 4 5 6 7 8 1 2 3 3 3 6 8 9 10 11 B B A A B C B C A C C 1 2 3 4 5 6 7 8 9 10 11

16 Compact Grid Build algorithm Traversal algorithm Time complexity
 Linear in the number of objects Space complexity Traversal algorithm Any grid traversal algorithm 12

17 Results Comparison to traditional grid data structures Memory usage
Build time 13 list array compact

18 Hashed Grid Reduce memory footprint even further Redundancy
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

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

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

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

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

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

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

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

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

27 Hashed Grid Build algorithm Time complexity: Bound Compute domain bits
Compute hash function Count Accumulate Insert Time complexity: Added Now work directly on the hash table instead of the linearized cell array 16

28 Results Compact grid  Hashed grid Scene: 3.64 M triangles, 124.84 MB
Memory object lists: MB Memory cells: MB  6.20 MB Build time: 0.39 s  0.72 s Render time: 2.49 s  2.52 s Cruiser 17 Scene: M triangles, MB Memory object lists: MB Memory cells: MB  8.97 MB Build time: 1.17 s  1.76 s Render time: 1.55 s  1.43 s Thai Statue

29 Results Comparison to traditional grid data structures Memory usage
Build time 18 list array compact hashed

30 Scene: 260 K triangles - FPS: 8.38 FPS (512 x 512)
Applications Interactive ray tracing of dynamic scenes 19 Scene: 260 K triangles - FPS: 8.38 FPS (512 x 512)

31 Applications Ray tracing large models (16 GB workstation)
Scene: M triangles, 1.89 GB Time to image: 7.55 s / s Memory usage: 1.17 GB / MB David 20 Scene: M triangles, GB Time to image: - / s Memory usage: - / 2.36 GB St. Matthew

32 Conclusion & Future Work
Two memory-efficient representations for grids for ray tracing 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 21

33 Thanks! Questions? http://www.cs.kuleuven.be/~ares/ 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.

34

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

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

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

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


Download ppt "Compact, Fast and Robust Grids for Ray Tracing"

Similar presentations


Ads by Google