1 / 29

Introduction to Ray Tracing

Introduction to Ray Tracing. Ray Tracing. Shoot a ray through each pixel; Find first object intersected by ray. Image plane. Eye. Compute ray. (More linear algebra.) Compute ray-object intersection. Ray Tracing. For each pixel Form ray from eye through pixel For each object

whitmans
Télécharger la présentation

Introduction to Ray Tracing

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. Introduction to Ray Tracing CSE 681

  2. Ray Tracing • Shoot a ray through each pixel; • Find first object intersected by ray. Image plane Eye • Compute ray. (More linear algebra.) • Compute ray-object intersection. CSE 681

  3. Ray Tracing • For each pixel • Form ray from eye through pixel • For each object • Intersection ray with object • If intersection is closer than any other so far, save it • Color pixel with shade of object at point of intersection CSE 681

  4. Example CSE 681

  5. Shade of Object at Point • Ambient • Diffuse • Specular • Shadows • Material properties • Texture • Reflections • Transparency (refraction) CSE 681

  6. Diffuse Reflection • Light that gets absorbed into the objects surface • Gets reflected equally in all directions • Need to calculate angle of incoming light to surface CSE 681

  7. Diffuse Reflection • Calculate amount/color of light shining on an object. • Depends on angle between light ray and surface normal. CSE 681

  8. Example: Diffuse reflection CSE 681

  9. Specular Reflection • Calculate light bouncing off object to your eye; • Angle of incidence = angle of reflection. • Most intense at angle of reflection; falls off from there Angle of incidence Angle of reflection Eye CSE 681

  10. Example: Specular Reflection CSE 681

  11. What’s wrong with this picture? CSE 681

  12. Shadows • Determine when light ray is blocked from reaching object. • Ray-object intersection calculation For each pixel for each object for each light source for each object CSE 681

  13. Eye Reflection Image plane CSE 681

  14. Transparency CSE 681

  15. Transparency & Refraction • Ray changes direction in transition between materials • Material properties give ratio of in/out angles CSE 681

  16. Transparency & Refraction CSE 681

  17. Eye Recursive Ray Tracing Image plane CSE 681

  18. Polyhedral Models CSE 681

  19. Texture Mapping CSE 681

  20. Sampling and Aliasing Problem: Representing pixel by a single ray. CSE 681

  21. Eye Anti-Aliasing Solution: • Use multiple rays; • Average values calculated by rays. Image plane CSE 681

  22. Sampling and Aliasing Problem: Sampling frequency may match image frequency. Image plane Eye Viewport CSE 681

  23. Random/Stochastic Sampling Randomly sample rays through pixel. Image plane Eye Viewport CSE 681

  24. Efficiency • 1280 x 1024 = 1,310,720  106 pixels. • 106 initial rays. • 106 reflection rays. • Potentially 106 refraction rays. • 3 x 106 shadow rays (3 lights.) Next level: • Potentially 4 x 106 refraction/reflection rays. 1,000,000 polygons. 107 x 106 = 1013 ray-polygon intersection calculations. CSE 681

  25. Intersection Data Structures • Coarse test to see if ray could *possibly* intersection object • Divide space up - sort objects into spatial buckets – trace ray from bucket to bucket CSE 681

  26. Bounding Boxes CSE 681

  27. Spatial Subdivision CSE 681

  28. Theory: sampling the environment • Rendering as sampling problem • Expected value & variance • Techniques to efficiently reduce variance CSE 681

  29. Major Course Topics • Object & coordinate transformations. • Ray-object intersections. • Diffuse & specular reflection. • Shadows. • Opacity & refraction. • Shadows. • Recursive ray tracing. • Polyhedral models. • Texture mapping. • Anti-aliasing and sampling. • Bounding boxes and spatial subdivision. • Sampling theory. CSE 681

More Related