Ray casting in computer graphics ppt

ray casting method computer graphics ppt and ray tracing method in computer graphics
Dr.ShaneMatts Profile Pic
Dr.ShaneMatts,United States,Teacher
Published Date:23-07-2017
Your Website URL(Optional)
Comment
Acceleration Structures for Ray Casting MIT EECS 6.837 Computer Graphics Wojciech Matusik, MIT EECS © ACM. All rights reserved. This content is excluded from our Creative Commons license. For more information, see http://ocw.mit.edu/help/faq-fair-use/. Hašan et al. 2007 1 Recap: Ray Tracing trace ray Intersect all objects color = ambient term For every light cast shadow ray Stopping criteria: color += local shading term • Recursion depth If mirror color += color – Stop after a refl trace reflected ray number If transparent of bounces color += color trans • Ray contribution trace transmitted ray – Stop if reflected / transmitted • Does it ever end? contribution becomes too small 2 Recursion For Reflection: None 0 recursion 3 Recursion For Reflection: 1 0 recursion 4 Recursion For Reflection: 2 0 recursion 5 Ray tree • Visualizing the ray tree for single image pixel incoming reflected ray shadow ray transmitted (refracted) ray 6 This gets pretty complicated Ray tree pretty fast • Visualizing the ray tree for single image pixel incoming reflected ray shadow ray transmitted (refracted) ray 7 Questions? 8 Ray Tracing Algorithm Analysis • Lots of primitives cost ≈ height width num primitives • Recursive intersection cost • Distributed Ray size of recursive ray tree num shadow rays Tracing num supersamples – Means using many num glossy rays rays for non- num temporal samples num aperture samples ideal/non-pointlike . . . phenomena • Soft shadows Can we reduce this? • Anti-aliasing • Glossy reflection • Motion blur • Depth of field 9 Today • Motivation – You need LOTS of rays to generate nice pictures – Intersecting every ray with every primitive becomes the bottleneck • Bounding volumes • Bounding Volume Hierarchies, Kd-trees For every pixel Construct a ray from the eye For every object in the scene Find intersection with the ray Keep if closest Shade 10 Accelerating Ray Casting • Goal: Reduce the number of ray/primitive intersections 11 Conservative Bounding Volume • First check for an intersection with a conservative bounding volume • Early reject: If ray doesn’t hit volume, it doesn’t hit the triangles 12 Conservative Bounding Volume • What does “conservative” mean? – Volume must be big enough to contain all geometry within 13 Conservative Bounding Regions • Desiderata – Tight → avoid false positives – Fast to intersect 14 Ray-Box Intersection • Axis-aligned box • Box: (X , Y , Z ) → (X , Y , Z ) 1 1 1 2 2 2 • Ray: P(t) = R + tR o d y=Y 2 y=Y 1 R x=X x=X d 1 2 R o 15 Naïve Ray-Box Intersection • 6 plane equations: Compute all intersections • Return closest intersection inside the box – Verify intersections are on the correct side of each plane: Ax+By+Cz+D 0 y=Y 2 y=Y 1 R x=X x=X d 1 2 R o 16 Reducing Total Computation • Pairs of planes have the same normal • Normals have only one non-zero component • Do computations one dimension at a time y=Y 2 y=Y 1 R x=X x=X d 1 2 R o 17 Test if Parallel • If R = 0 (ray is parallel) AND dx R X or R X → no intersection ox 1 ox 2 y=Y 2 y=Y 1 R (The same d for Y and Z, x=X x=X 1 2 of course) R o 18 Find Intersections Per Dimension • Basic idea – Determine an interval along the ray for each dimension – The intersect these 1D intervals (remember CSG) – Done y=Y 2 R o y=Y 1 x=X x=X 1 2 19 Find Intersections Per Dimension • Basic idea – Determine an interval along the ray for each dimension – The intersect these 1D intervals (remember CSG) – Done Interval between X 1 y=Y 2 and X 2 R o y=Y 1 x=X x=X 1 2 20