Ray Tracing Dr Scott Schaefer 1 Ray Tracing

  • Slides: 42
Download presentation
Ray Tracing Dr. Scott Schaefer 1

Ray Tracing Dr. Scott Schaefer 1

Ray Tracing n Provides rendering method with u Refraction/Transparent surfaces u Reflective surfaces u

Ray Tracing n Provides rendering method with u Refraction/Transparent surfaces u Reflective surfaces u Shadows 2/42

Ray Tracing n Provides rendering method with u Refraction/Transparent surfaces u Reflective surfaces u

Ray Tracing n Provides rendering method with u Refraction/Transparent surfaces u Reflective surfaces u Shadows Image taken from http: //radsite. lbl. gov/radiance/book/img/plate 10. jpg 3/42

Ray Tracing n Provides rendering method with u Refraction/Transparent surfaces u Reflective surfaces u

Ray Tracing n Provides rendering method with u Refraction/Transparent surfaces u Reflective surfaces u Shadows Image taken from http: //www. tjhsst. edu/~dhyatt/superap/samplex. jpg 4/42

Ray Tracing n Provides rendering method with u Refraction/Transparent surfaces u Reflective surfaces u

Ray Tracing n Provides rendering method with u Refraction/Transparent surfaces u Reflective surfaces u Shadows 5/42

Essential Information for Ray Tracing Eye point n Screen position/orientation n Objects u Material

Essential Information for Ray Tracing Eye point n Screen position/orientation n Objects u Material properties u Reflection/Refraction coefficients u Index of refraction n Light sources n 6/42

Recursive Ray Tracing n For each pixel u Intersect ray from eye through pixel

Recursive Ray Tracing n For each pixel u Intersect ray from eye through pixel with all objects in scene u Find closest (positive) intersection to eye u Compute lighting at intersection point u Recur for reflected and refracted rays (if necessary) 7/42

screen eye 8/42

screen eye 8/42

screen eye 9/42

screen eye 9/42

screen eye 10/42

screen eye 10/42

normal screen eye 11/42

normal screen eye 11/42

Ray Casting Removes hidden surfaces n Per-pixel lighting computations n 12/42

Ray Casting Removes hidden surfaces n Per-pixel lighting computations n 12/42

Shadows Cast a virtual ray to each light source n If ray hits an

Shadows Cast a virtual ray to each light source n If ray hits an opaque object before the light, then omit contribution of that light n If ray hits a semi-transparent object, scale the contribution of that light and continue to look for intersections n Note: objects may be self-shadowing!!! n 13/42

shadow ray normal screen eye 14/42

shadow ray normal screen eye 14/42

Shadows 15/42

Shadows 15/42

Shadows 16/42

Shadows 16/42

normal reflected ray screen eye 17/42

normal reflected ray screen eye 17/42

shadow ray normal reflected ray normal screen eye 18/42

shadow ray normal reflected ray normal screen eye 18/42

normal reflected ray screen eye 19/42

normal reflected ray screen eye 19/42

Reflection n Mirror-like/Shiny objects Surface 20/42

Reflection n Mirror-like/Shiny objects Surface 20/42

refracted ray normal screen eye 21/42

refracted ray normal screen eye 21/42

Refraction Bending of light caused by different speeds of light in different medium n

Refraction Bending of light caused by different speeds of light in different medium n Each (semi-)transparent object has an index of refraction ni or phase velocity of light ci n Use Snell’s law to find refracted vector n Image taken from http: //hyperphysics. phy-astr. gsu. edu/hbase/geoopt/refr 2. html 22/42

Snell’s Law c=speed of light in vacuum Surface 23/42

Snell’s Law c=speed of light in vacuum Surface 23/42

Snell’s Law Surface 24/42

Snell’s Law Surface 24/42

Snell’s Law Surface 25/42

Snell’s Law Surface 25/42

Snell’s Law Surface 26/42

Snell’s Law Surface 26/42

Snell’s Law Surface 27/42

Snell’s Law Surface 27/42

Snell’s Law Surface 28/42

Snell’s Law Surface 28/42

Snell’s Law Surface 29/42

Snell’s Law Surface 29/42

Snell’s Law Surface 30/42

Snell’s Law Surface 30/42

Snell’s Law Surface 31/42

Snell’s Law Surface 31/42

Snell’s Law Surface 32/42

Snell’s Law Surface 32/42

Total Internal Reflection Surface 33/42

Total Internal Reflection Surface 33/42

Recursive Ray Tracing Truncate at finite depth! 34/42

Recursive Ray Tracing Truncate at finite depth! 34/42

Recursive Ray Tracing n Recur for reflective/transparent objects 35/42

Recursive Ray Tracing n Recur for reflective/transparent objects 35/42

Recursive Ray Tracing n Recur for reflective/transparent objects 36/42

Recursive Ray Tracing n Recur for reflective/transparent objects 36/42

Optimizations Lots of rays to cast! n Ray-Surface intersections are expensive n Associate with

Optimizations Lots of rays to cast! n Ray-Surface intersections are expensive n Associate with each object u Bounding box in 3 -space n If ray doesn’t intersect box, then ray doesn’t intersect object n 37/42

Parallel Processing n Ray tracing is a trivially parallel algorithm! u Cast rays in

Parallel Processing n Ray tracing is a trivially parallel algorithm! u Cast rays in parallel u Cast reflection, refraction, shadow rays in parallel u Calculate ray/surface intersections independently in parallel 38/42

Ray Tracing: Special Effects copyright Newline Cinema 39/42

Ray Tracing: Special Effects copyright Newline Cinema 39/42

Ray Tracing: Video Games 40/42

Ray Tracing: Video Games 40/42

Ray Tracing: Massive Models 41/42

Ray Tracing: Massive Models 41/42

Extensions of Ray Tracing n Only considers totally specular interactions u n rays either

Extensions of Ray Tracing n Only considers totally specular interactions u n rays either reflect perfectly or refract perfectly Ray traced scenes don't show “color bleed” 42/42