Ray Tracing
Instructor: Christopher Rasmussen (cer@cis.udel.edu)
April 29 2021 ❖ Lecture 20
Outline
Ray Tracing: NVidia demo (fall, 2018)
Ray Casting
Lighting a point
from Hill
Ray Casting: Details
from Hill
from Woo et al.
Does Ray Intersect any Scene Primitives?
from Hill
Ray-Sphere Intersection I
with ray equation
(where d is a unit vector) to get:
Ray-Sphere Intersection II
to solve for t, resulting in a quadratic equation with roots given by:
Ray-Polygon Intersection
Ray-Triangle Intersection
v1
v2
v3
Ray-Triangle Intersection
v1
v2
v3
Lighting a point
from Hill
Ray-Cast Scene with and without Shadows
from Hill
Shadow Rays
Shadow Rays
from Hill
Ray Casting Example: No shadows
Light 1 only
Light 2 only
Lights 1 and 2
Ray Casting Examples: Shadows
Light 1 only
Light 2 only
Lights 1 and 2
Distributed (aka “distribution”) Ray Tracing (DRT) application: Soft Shadows
Distributed (aka “distribution”) Ray Tracing (DRT) application: Soft Shadows
Soft Shadows: Example
1 shadow ray
10 shadow rays
50 shadow rays
Note discrete "shadow points" -- need post-processing to smooth into contiguous region
Ambient Occlusion
Ambient Occlusion: Example
Ambient Occlusion: Example
http://www.gavinharrison.co.uk/renderman04.php
Nvidia demo:
Shadow Rays + Ambient Occlusion
shadow material 0:07-3:30
Backward Ray “Following”: Types
Angel
Ray “tracing” for more realism
courtesy of J. Arvo
Refraction
Glossy reflection
Ray Tracing
from Hill
Ray Tracing: Recursion
from Hill
Reflections
incident ray v
reflected ray r
Review: Reflection direction for Phong model
(twice the projection of l onto n)
Ray Tracing Reflection Formula
Example: Reflections at depth = 0
Example: Reflections at depth = 1
Example: Reflections at depth = 2
Example: Reflections at depth = 3
Another DRT Application: Glossy Reflections
Why is the reflection sharper at the top?
DRT for Glossy Reflections
from Hill
Nvidia demo:
Reflections
reflection material 3:31-5:43 -- note variable glossiness of floor