Presentation is loading. Please wait.

Presentation is loading. Please wait.

Ray Tracing Acceleration Techniques

Similar presentations


Presentation on theme: "Ray Tracing Acceleration Techniques"— Presentation transcript:

1 Ray Tracing Acceleration Techniques
Approaches Faster Intersection Fewer Rays Generalized N 1 Tighter bounds Faster intersector Uniform grids Spatial hierarchies k-d, oct-tree, bsp hierarchical grids Hierarchical bounding volumes (HBV) Early ray termination Adaptive sampling Beam tracing Cone tracing Pencil tracing Readings Arvo and Kirk Arvo, Metahierarchies Havran and “Best Efficiency Scheme” Beam tracing techniques fail for two reasons: Intersection calculations are too complicated; imagine cone-algebraic surface Beams don’t remain closed under reflection and refraction off curved surfaces Bounds First test bounds, then do detailed intersection calculation Trade-off on how tight the bounds are; the tighter the bound, the higher the Probability of a real intersection given an intersection with the bound, but the higher the cost of rejection.

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

3 Uniform Grids Preprocess scene 1. Find bounding box
Two reasons for using a grid. Cull out objects not near the ray. Only consider those objects in the voxels along the ray’s path Early termination. Stop when you find the point of closest intersection.

4 Uniform Grids Preprocess scene Find bounding box Determine resolution
Setting the resolution is tricky. If the resolution is too high, then you step through too many voxels. If the resolution is too low, then you perform too many intersections. Add Tim’s study of voxel density. Roughly set so that the average time spent walking voxels is equal to the average time spent test for intersection. D=3 is typical. Woo describes an algorithm for non-uniformly allocating voxels in each direction. D is the voxel density, and was introduced by Cleary and Wyvill?

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

6 Uniform Grids Preprocess scene Find bounding box Determine resolution
3. Place object in cell, if object overlaps cell 4. Check that object intersects cell Could remove interior voxels as well.

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

8 Caveat: Overlap Optimize for objects that overlap multiple cells
Traverse until tmin(cell) > tmax(ray) Problem: Redundant intersection tests: Solution: Mailboxes Assign each ray an increasing number Primitive intersection cache (mailbox) Store last ray number tested in mailbox Only intersect if ray number is greater Mailboxes first proposed by Amanaidas and Woo Each ray is assigned a unique number. Latter rays have higher numbers than earlier rays. Store the ray number with each primitive. Don’t test rays if their ray number is less than or equal to the primitive’s ray number.

9 Spatial Hierarchies Letters correspond to planes (A)
As questions? Kay-Kajiya Properties of hierarchical bounding volumes A Letters correspond to planes (A) Point Location by recursive search

10 Spatial Hierarchies Letters correspond to planes (A, B)
As questions? Kay-Kajiya Properties of hierarchical bounding volumes Letters correspond to planes (A, B) Point Location by recursive search

11 Spatial Hierarchies Letters correspond to planes (A, B, C, D)
As questions? Kay-Kajiya Properties of hierarchical bounding volumes Letters correspond to planes (A, B, C, D) Point Location by recursive search

12 Variations kd-tree oct-tree bsp-tree Variations.
Kd-tree where you set the position of the splitting plane. Oct-tree where you set the position of the center point. kd-tree oct-tree bsp-tree

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

14 Build Hierarchy Top-Down
? What exactly is the surface-area heuristic Choose splitting plane Midpoint Median cut Surface area heuristic

15 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: For a convex body For example: sphere

16 Surface Area and Rays The probability of a ray hitting a convex shape
that is completely inside a convex cell equals Question after class. How is this used? Need to show in detail how this information Is used to find the optimal hierarchy.

17 Surface Area Heuristic
Intersection time Traversal time a b What exactly is the surface-area heuristic

18 Surface Area Heuristic
2n splits a b What exactly is the surface-area heuristic

19 V. Havran, Best Efficiency Scheme Project
Comparison Can’t find this data! No one method works best for all scenes Running times sensitive to parameters Uniform grids have difficulty with non-uniform object distributions Recent study showed that KD trees are very good The whole subject is religious Go to BES and RTNEWS V. Havran, Best Efficiency Scheme Project

20 Comparison

21 Univ. Saarland RTRT Engine
Ray-casts per second = 1K × 1K Pentium-IV 2.5GHz laptop Kd-tree with surface-area heuristic [Havran] Wald et al [ RT&Shading Scene SSE no shd. simple shd. No SSE ERW6 (static) 7.1 2.3 1.37 ERW6 (dynamic) 4.8 1.97 1.06 Conf (static) 4.55 1.93 1.2 Conf (dynamic) 2.94 1.6 0.82 Soda Hall 4.12 1.8 1.055 ERW6 is 800,000 triangles SODA Hall is 2.5 MT

22 Interactive Ray Tracing
Highly optimized software ray tracers Use vector instructions; Cache optimized Clusters and shared memory MPs Ray tracing hardware AR250/350 ray tracing processor SaarCOR Ray tracing on programmable GPUs

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

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


Download ppt "Ray Tracing Acceleration Techniques"

Similar presentations


Ads by Google