1 / 39

Ray Tracing

Ray Tracing. Photo-Realism. Created by David Derman – CISC 440. Created by Jan Oberlaender – CISC 640. Created by Jan Oberlaender – CISC 640. Created by Donald Hyatt http://www.tjhsst.edu/~dhyatt/superap/povray.html. RAY Tracing. Ray Tracing :

Download Presentation

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. Ray Tracing

  2. Photo-Realism Created by David Derman – CISC 440

  3. Created by Jan Oberlaender – CISC 640

  4. Created by Jan Oberlaender – CISC 640

  5. Created by Donald Hyatt http://www.tjhsst.edu/~dhyatt/superap/povray.html

  6. RAY Tracing • Ray Tracing : Ray tracing is a method for calculating the path of waves or particles through a system. RAY

  7. Sun Ray

  8. Types of Rays Ray tracing in Physics: Which is used for analyzing optical and other systems.

  9. Types of Rays Ray tracing Graphics : which is used for 3D image generation

  10. Ray tracing Graphics

  11. How it Works Ray Tracing : technique use for generating an 3-D image by Tracing the path of Light through Pixels in an Image Plane and simulating the effects of its encounters with virtual objects.

  12. Introduction • Ray Tracing based rendering method for generating realistic images on the computer. • In ray tracing, a ray of light is traced in a forward and backwards direction.

  13. Overview • Forward Ray tracing • Rays from light source bounce of objects before reaching the camera • Computational wastage • Backward Ray tracing • Track only those rays that finally made it to the camera Courtesy: Angel

  14. Ray Tracing • We start from the eye or camera and trace the ray through a pixel in the image plane into the scene and determine what it intersects. • The pixel is then set to the color values returned by the ray. • If the ray misses all objects, then that pixel is shaded the background color.

  15. Ray Tracing • Sometimes a ray misses all objects

  16. Ray Tracing (contd.) • Sometimes a ray hits an object

  17. Ray Tracing (contd.) • Sometimes Ray intersect point`s and Reflect Back To Light Source.

  18. Ray Tracing (contd.) • Shadow rays intersect another object • First intersection point in shadow of the second object

  19. Ray Tracing (contd.) • Reflected ray generated at point of intersection • Tested with all the objects in the scene

  20. Ray Tracing (contd.) • Local illumination model applied at the point of intersection

  21. Ray Tracing (contd.) • Transparent object • Generate a transmitted ray and test against all objects in the scene

  22. Effects Of Ray on Object When Ray Hit the Surface of an Object it produce different effect`s. • Reflection. • Refraction/Transmission. • Shadow

  23. Reflection

  24. Reflection Created by David Derman – CISC 440

  25. Reflection Created by David Derman – CISC 440

  26. Reflection Created by David Derman – CISC 440

  27. Reflection Created by David Derman – CISC 440

  28. Refraction • Bending of light rays as it crosses interface between media having different refractive indices • Snell’s Law c1,c2 – Refractive index Courtesy F.S. Hill, “Computer Graphics using OpenGL”

  29. Refraction

  30. Refraction

  31. Adding shadows Shadow Feelers : A shadow feeler is a ray sent from a point u on the surface of an object towards a light source to determine whether the light is visible from the point u or whether it is occluded by intervening objects.

  32. Shadow Feeler • If the shadow feeler hits an object before reaching the light, then the light is presumed to be occluded by the object so that the point is in a shadow.

  33. Shadow Effects

  34. Angle Dependent Reflection

  35. Angle Of incident <180 <90

  36. Ray object intersection • Equation of a ray • “S” is the starting point and “c” is the direction of the ray, t is angle • Given a surface in implicit form F(x,y,z) • plane: • sphere: • cylinder: • All points on the surface satisfy F(x,y,z)=0

  37. Ray Tracing Algorithm • Begin tracing. • Construct a ray through each pixel in the scene. • Pixel color = result of tracing the ray • Tracing the ray • Find intersection of ray with closest object in the scene. • Compute intersection point and normal at the intersection point. • Shade the point. • Shade the point • For each light… • Determine if point is in shadow relative to light source. • Using illumination model, determine color at the intersection point.

  38. Ray Tracing Algorithm integer i, j; ray r; { defines starting point and direction of ray } point eyePt, hitPt; shape pointer hitObjP; real array I [XMIN .. XMAX, YMIN .. YMAX]; for i:=YMIN to YMAX do for j:=XMIN to XMAX do begin ComputeRay (i,j,r); FirstIntersection1 (r,hitPt,hitN,hitObjP); if hitObjPπ nil then I[i,j] := Shade (eyePt,nil,hitPt,hitN,hitObjP,1) else I[i,j] := background end; procedure ComputeRay (integer i, j; ref ray r) { Computes the ray r (in world coordinates) from the eye defined by the (i,j)th pixel } procedure FirstIntersection1 (ray r; ref point hitPt, hitN; ref shape pointer hitObjP) { Returns a pointer hitObjP to the closest object intersected by the ray r, the point hitPt on that object where the ray intersects it, and the surface normal hitN at that point. Use bounding boxes for projected objects in view plane to speed up computation. }

More Related