1 / 19

Ray Tracing 2: Acceleration

Ray Tracing 2: Acceleration. Ray Tracing Acceleration Techniques. Too Slow!. Faster intersection. Fewer rays. Generalized rays. N. 1. Uniform grids Spatial hierarchies K-D Octtree BSP Hierarchical grids Hierarchical bounding volumes (HBV). Tighter bounds Faster intersector.

chaim
Download Presentation

Ray Tracing 2: Acceleration

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Ray Tracing 2:Acceleration

  2. Ray Tracing Acceleration Techniques Too Slow! Faster intersection Fewer rays Generalized rays N 1 • Uniform grids • Spatial hierarchies • K-D • Octtree • BSP • Hierarchical grids • Hierarchical • bounding • volumes (HBV) Tighter bounds Faster intersector Early ray termination Adaptive sampling Beam tracing Cone tracing Pencil tracing

  3. Preprocess scene Find bounding box Uniform Grids

  4. Preprocess scene Find bounding box Determine grid resolution Uniform Grids

  5. Preprocess scene Find bounding box Determine grid resolution Place object in cell if its bounding box overlaps the cell Uniform Grids

  6. Preprocess scene Find bounding box Determine grid resolution Place object in cell if its bounding box overlaps the cell Check that object overlaps cell (expensive!) Uniform Grids

  7. Preprocess scene Traverse grid 3D line = 3D-DDA 6-connected line Uniform Grids

  8. Caveat: Overlap • Optimize objects that overlap multiple cells • Caveat 1 (correctness): • Intersection must lie within current cell • Caveat 2 (efficiency): • Redundant intersection tests • “Mailboxes” • Assign each ray a number • Object intersection cache (“mailbox”) • Store ray number, intersection information

  9. Spatial Hierarchies A D B B C C D A Leaf nodes correspond to unique regions in space

  10. Spatial Hierarchies A D B B C C D A Point location by recursive search

  11. Variations octtree BSP tree KD tree

  12. Creating Spatial Hierarchies • insert(node,prim) { • if( overlap(node->bound,prim) ) • if( leaf(node) ) { • if( node->nprims > MAXPRIMS && • node->depth < MAXDEPTH ) { • subdivide(node); • foreach child in node • insert(child,prim) • } • else list_insert(node->prims,prim); • } • else • foreach child in node • insert(child,prim) • } • // Typically MAXDEPTH=16, MAXPRIMS=2-8

  13. Median-Cut • Build hierarchy bottom-up • Chose direction and position carefully • Surface-area heuristic

  14. 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: • Example: Sphere

  15. Surface Area and Rays • Probability of a ray hitting an object that is completely inside a cell is:

  16. Intersect(L,tmin,tmax) Intersect(L,tmin,t*) Intersect(R,t*,tmax) Intersect(R,tmin,tmax) Ray Traversal Algorithms • Recursive inorder traversal • Kaplan, Arvo, Jansen

  17. IMAGE IMAGE IMAGE Hierarchical Grids • Good compromise preferred by many practitioners

  18. Hierarchical Bounding Volumes • Create tree of bounding volumes • Children are contained within parent • Creation preprocess • From model hierarchy • Automatic clustering • Search • intersect(node,ray,hits) { • if( intersectp(node->bound,ray) • if( leaf(node) ) • intersect(node->prims,ray,hits) • else • for each child • inter sect(child,ray,hits) • }

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

More Related