Presentation is loading. Please wait.

Presentation is loading. Please wait.

Ray Tracing Acceleration (1). Acceleration of Ray Tracing Goal: Reduce the number of ray/primitive intersections.

Similar presentations


Presentation on theme: "Ray Tracing Acceleration (1). Acceleration of Ray Tracing Goal: Reduce the number of ray/primitive intersections."— Presentation transcript:

1 Ray Tracing Acceleration (1)

2 Acceleration of Ray Tracing Goal: Reduce the number of ray/primitive intersections

3 Acceleration of Ray Tracing Finding ray-object intersection is computationally expensive. Brute force approach (no acceleration): –Test each ray with all objects –Obtain the smallest t value as the closest intersection.

4 Acceleration of Ray Tracing For a scene containing –|O| number of objects and –a resulting image composed of |I| pixels, –the complexity will be |I| × |O|. Ignoring super-sampling, reflection and refraction calculation: –one million objects with 10242 pixels –will result in one trillion ray-object intersection calculations. –It’s bad!!

5 Acceleration of Ray Tracing Different data structures used to accelerate the computation. Below is a survey of ray tracing acceleration techniques by James Arvo and David Kirk.

6 Our Focus

7 Faster Intersections (1) Better optimizing code Finding bounding volume that tightly fits an object Efficient for intersection check.

8 Faster Intersections (2) Fewer ray-object intersection Won’t speed up individual intersection Will determine intersection of a ray with N objects in sub-linear time.

9 Ray Tracing Acceleration Techniques Too Slow! 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 Faster intersection N1 Fewer raysGeneralized rays

10 Roadmap (LRT book, ch 4 – Intersection Acceleration) Approaches To Reducing Intersections –Ray-Box Intersections –Regular Grid –Hierarchical bounding volumes –BSP trees and friends –Meta-Hierarchies –Refinements to basic approaches Hierarchical Grid Accelerator –Creation –Traversal Kd Tree –Tree Representation –Tree construction –Traversal Further Reading

11 Ray Tracing Acceleration Techniques Too Slow! 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 Faster intersection N1 Fewer raysGeneralized rays

12 Roadmap (LRT book, ch 4 – Intersection Acceleration) Approaches To Reducing Intersections –Ray-Box Intersections –Regular Grid –Hierarchical bounding volumes –BSP trees and friends –Meta-Hierarchies –Refinements to basic approaches Hierarchical Grid Accelerator –Creation –Traversal Kd Tree –Tree Representation –Tree construction –Traversal Further Reading

13 Acceleration of Ray Tracing Goal: Reduce the number of ray/primitive intersections

14 Conservative Bounding Region First check for an intersection with a conservative bounding region Early reject

15 Conservative Bounding Regions axis-aligned bounding box non-aligned bounding box bounding sphere arbitrary convex region (bounding half-spaces) tight → avoid false positives fast to intersect

16 Intersection with Axis-Aligned Box For all 3 axes, calculate the intersection distances t 1 and t 2 t near = max (t 1x, t 1y, t 1z ) t far = min (t 2x, t 2y, t 2z ) If t near > t far, box is missed If t far < t min, box is behind If box survived tests, report intersection at t near y=Y2 y=Y1 x=X1 x=X2 t near t far t 1x t 1y t 2x t 2y

17 Bounding Box of a Triangle (x min, y min, z min ) (x max, y max, z max ) (x 0, y 0, z 0 ) (x 1, y 1, z 1 ) (x 2, y 2, z 2 ) = (min(x 0,x 1,x 2 ), min(y 0,y 1,y 2 ), min(z 0,z 1,z 2 )) = (max(x 0,x 1,x 2 ), max(y 0,y 1,y 2 ), max(z 0,z 1,z 2 ))

18 Bounding Box of a Sphere r (x min, y min, z min ) (x max, y max, z max ) (x, y, z) = (x-r, y-r, z-r) = (x+r, y+r, z+r)

19 Bounding Box of a Plane (x min, y min, z min ) (x max, y max, z max ) = (-∞, -∞, -∞)* = (+∞, +∞, +∞)* n = (a, b, c) ax + by + cz = d * unless n is exactly perpendicular to an axis

20 Bounding Box of a Group (x min_b, y min_b, z min_b ) (x min, y min, z min ) (x max, y max, z max ) = (min(x min_a,x min_b ), min(y min_a,y min_b ), min(z min_a,z min_b )) = (max(x max_a,x max_b ), max(y max_a,y max_b ), max(z max_a,z max_b )) (x min_a, y min_a, z min_a ) (x max_b, y max_b, z max_b ) (x max_a, y max_a, z max_a )

21 Bounding Box of a Transform (x' min, y' min, z' min ) (x' max, y' max, z' max ) = (min(x 0,x 1,x 2,x 3,x 4,x 5,x 6,x 7 ), min(y 0,y 1,y 2,y 3,y 4,x 5,x 6,x 7 ), min(z 0,z 1,z 2,z 3,z 4,x 5,x 6,x 7 )) M (x min, y min, z min ) (x 0,y 0,z 0 ) = M (x min,y min,z min ) = (max(x 0,x 1,x 2,x 3,x 4,x 5,x 6,x 7 ), max(y 0,y 1,y 2,y 3,y 4,x 5,x 6,x 7 ), max(z 0,z 1,z 2,z 3,z 4,x 5,x 6,x 7 )) (x 1,y 1,z 1 ) = M (x max,y min,z min ) (x 2,y 2,z 2 ) = M (x min,y max,z min ) (x 3,y 3,z 3 ) = M (x max,y max,z min ) (x max, y max, z max )

22 Special Case: Transformed Triangle M Can we do better?

23 (x max, y max, z max ) = (max(x' 0,x' 1,x' 2 ), max(y' 0,y' 1,y' 2 ), max(z' 0,z' 1,z' 2 )) M (x min, y min, z min ) = (min(x' 0,x' 1,x' 2 ), min(y' 0,y' 1,y' 2 ), min(z' 0,z' 1,z' 2 )) (x' 0,y' 0,z' 0 ) = M (x 0,y 0,z 0 ) (x' 1,y' 1,z' 1 ) = M (x 1,y 1,z 1 ) (x' 2,y' 2,z' 2 ) = M (x 2,y 2,z 2 ) (x 2, y 2, z 2 ) (x 1, y 1, z 1 ) (x 0, y 0, z 0 ) Special Case: Transformed Triangle


Download ppt "Ray Tracing Acceleration (1). Acceleration of Ray Tracing Goal: Reduce the number of ray/primitive intersections."

Similar presentations


Ads by Google