Ray Tracing Acceleration Techniques Approaches Faster Intersection N

  • Slides: 24
Download presentation
Ray Tracing Acceleration Techniques Approaches Faster Intersection N Uniform grids Spatial hierarchies k-d, oct-tree,

Ray Tracing Acceleration Techniques Approaches Faster Intersection N Uniform grids Spatial hierarchies k-d, oct-tree, bsp hierarchical grids Hierarchical bounding volumes (HBV) Fewer Rays Generalized Rays 1 Tighter bounds Faster intersector Early ray termination Adaptive sampling Beam tracing Cone tracing Pencil tracing

Primitives pbrt primitive base class n n Shape Material and emission (area light) Primitives

Primitives pbrt primitive base class n n Shape Material and emission (area light) Primitives n n Basic geometric primitive Primitive instance n n Transformation and pointer to basic primitive Aggregate (collection) n n Treat collections just like basic primitives Incorporate acceleration structures into collections May nest accelerators of different types Types: grid. cpp and kdtree. cpp

Uniform Grids Preprocess scene n Find bounding box

Uniform Grids Preprocess scene n Find bounding box

Uniform Grids Preprocess scene n Find bounding box n Determine resolution

Uniform Grids Preprocess scene n Find bounding box n Determine resolution

Uniform Grids Preprocess scene n n n Find bounding box Determine resolution Place object

Uniform Grids Preprocess scene n n n Find bounding box Determine resolution Place object in cell, if object overlaps cell

Uniform Grids Preprocess scene n n Find bounding box Determine resolution Place object in

Uniform Grids Preprocess scene n n Find bounding box Determine resolution Place object in cell, if object overlaps cell Check that object intersects cell

Uniform Grids Preprocess scene Traverse grid 3 D line – 3 D-DDA 6 -connected

Uniform Grids Preprocess scene Traverse grid 3 D line – 3 D-DDA 6 -connected line Section 4. 3

Caveat: Overlap Optimize for objects that overlap multiple cells Traverse until tmin(cell) > tmax(ray)

Caveat: Overlap Optimize for objects that overlap multiple cells Traverse until tmin(cell) > tmax(ray) Problem: Redundant intersection tests: Solution: Mailboxes n n Assign each ray an increasing number Primitive intersection cache (mailbox) n n Store last ray number tested in mailbox Only intersect if ray number is greater

Spatial Hierarchies A A Letters correspond to planes (A) Point Location by recursive search

Spatial Hierarchies A A Letters correspond to planes (A) Point Location by recursive search

Spatial Hierarchies A B B A Letters correspond to planes (A, B) Point Location

Spatial Hierarchies A B B A Letters correspond to planes (A, B) Point Location by recursive search

Spatial Hierarchies A D B B C C D A Letters correspond to planes

Spatial Hierarchies A D B B C C D A Letters correspond to planes (A, B, C, D) Point Location by recursive search

Variations kd-tree oct-tree bsp-tree

Variations kd-tree oct-tree bsp-tree

Ray Traversal Algorithms Recursive inorder traversal [Kaplan, Arvo, Jansen] Intersect(L, tmin, tmax) Intersect(L, tmin,

Ray Traversal Algorithms Recursive inorder traversal [Kaplan, Arvo, Jansen] Intersect(L, tmin, tmax) Intersect(L, tmin, t*) Intersect(R, tmin, tmax) Intersect(R, t*, tmax)

Build Hierarchy Top-Down ? Choose splitting plane • Midpoint • Median cut • Surface

Build Hierarchy Top-Down ? Choose splitting plane • Midpoint • Median cut • Surface area heuristic

Surface Area and Rays Number of rays in a given direction that hit an

Surface Area and Rays Number of rays in a given direction that hit an object is proportional to its projected area The total number of rays hitting an object is Crofton’s Theorem: n For a convex body For example: sphere

Surface Area and Rays The probability of a ray hitting a convex shape that

Surface Area and Rays The probability of a ray hitting a convex shape that is completely inside a convex cell equals

Surface Area Heuristic Intersection time Traversal time a b

Surface Area Heuristic Intersection time Traversal time a b

Surface Area Heuristic 2 n splits a b

Surface Area Heuristic 2 n splits a b

Comparison V. Havran, Best Efficiency Scheme Project http: //sgi. felk. cvut. cz/BES/

Comparison V. Havran, Best Efficiency Scheme Project http: //sgi. felk. cvut. cz/BES/

Comparison

Comparison

Univ. Saarland RTRT Engine Ray-casts per second = FPS @ 1 K × 1

Univ. Saarland RTRT Engine Ray-casts per second = FPS @ 1 K × 1 K RT&Shadin SSE g no shd. simple shd. Scene ERW 6 (static) 7. 1 ERW 6 (dynamic) 4. 8 Conf (static) 4. 55 Conf (dynamic) 2. 94 Pentium-IV 2. 5 GHz laptop Soda Hall 4. 12 2. 3 1. 97 1. 93 1. 6 1. 8 No SSE simple shd. 1. 37 1. 06 1. 2 0. 82 1. 055 • Kd-tree with surface-area heuristic [Havran] • Wald et al. 2003 [http: //www. mpi-sb. mpg. de/~wald/]

Interactive Ray Tracing Highly optimized software ray tracers n n Use vector instructions; Cache

Interactive Ray Tracing Highly optimized software ray tracers n n Use vector instructions; Cache optimized Clusters and shared memory MPs Ray tracing hardware n AR 250/350 ray tracing processor www. art-render. com n Saar. COR Ray tracing on programmable GPUs

Theoretical Nugget 1 Computational geometry of ray shooting 1. Triangles (Pellegrini) Time: n Space:

Theoretical Nugget 1 Computational geometry of ray shooting 1. Triangles (Pellegrini) Time: n Space: n 2. Sphere (Guibas and Pellegrini) Time: n Space: n

Theoretical Nugget 2 Optical computer = Turing machine y = y+1 Reif, Tygar, Yoshida

Theoretical Nugget 2 Optical computer = Turing machine y = y+1 Reif, Tygar, Yoshida Determining if a ray starting at y 0 arrives at yn is undecidable y = -2*y if( y>0 )