Upload
others
View
1
Download
0
Embed Size (px)
Citation preview
1
CS-C3100 Computer Graphics 13.1 A simple shading model for Ray Tracing
Jaakko Lehtinen with lots of material from Frédo Durand
Hen
rik W
ann
Jens
en
In This Video
2
• A simple shading model for a simple ray tracer – Point-light illumination – Shadows – Reflections – Refractions
NVIDIA
3
Today – Ray Tracing(Indirect illumination)
Shadows
ReflectionsRefractions
(Caustics)
Hen
rik W
ann
Jens
en
A Very Simple Shading Model
4
• A subset of “Whitted ray tracing” – Turner Whitted, An Improved Illumination Model for
Shaded Display, Comm. ACM, 1980
• Just for illustration really, we’ll be looking at other models shortly
RoRd
N
A Very Simple Shading Model
5
• A subset of “Whitted ray tracing” – Turner Whitted, An Improved Illumination Model for
Shaded Display, Comm. ACM, 1980 • Light towards the eye I is...
RoRd
NL
direct lightingI = kd max(0,L ·N)V (L)
A Very Simple Shading Model
6
• A subset of “Whitted ray tracing” – Turner Whitted, An Improved Illumination Model for
Shaded Display, Comm. ACM, 1980 • Light towards the eye I is...
RoRd
NLR
+ ks I(R)I = kd kl max(0,L · N)
mirror reflection
direct lightingI = kd max(0,L ·N)V (L)
A Very Simple Shading Model
7
• A subset of “Whitted ray tracing” – Turner Whitted, An Improved Illumination Model for
Shaded Display, Comm. ACM, 1980 • Light towards the eye I is...
RoRd
NLR
T
+ ks I(R)+ kt I(T )
I = kd kl max(0,L · N)mirror reflection
mirror refraction
direct lightingI = kd max(0,L ·N)V (L)
+ ks I(R)
A Very Simple Shading Model
8
• A subset of “Whitted ray tracing” – Turner Whitted, An Improved Illumination Model for
Shaded Display, Comm. ACM, 1980 • Light towards the eye I is...
RoRd
NLR
T
+ kt I(T )
I(R) is light from mirror direction R I(T) is refracted light from direction T kd, ks, and kt are diffuse, specular and refraction coefficients
I = kd kl max(0,L · N)mirror reflection
mirror refraction
direct lightingI = kd max(0,L ·N)V (L)
Our Placeholder Model
9
• V(L) is visibility of light source (0 or 1) • kd, ks, kt are material properties
– ka global constant, kl is light color • We are ignoring (e.g.)
– Specular reflection from the light (only diffuse N.L) – Distance falloff (only angle of normal and L)
+ ks I(R)+ kt I(T )
kd = diffuse coefficient (“color”)
ks = specular coefficient (“color”)
kt mirror refraction coefficient
+ kd ka ambient lighting
I = kd kl max(0,L · N)I = kd max(0,L ·N)V (L)
Where Do These Come From?
10
• “Light incident from reflected direction” • “Light incident from refracted direction” • Light going towards the camera
• We’ll recurse and use the same function again
+ ks I(R)+ kt I(T )
kd = diffuse coefficient (“color”)
ks = specular coefficient (“color”)
kt mirror refraction coefficient
+ kd ka ambient lighting
I = kd kl max(0,L · N)I = kd max(0,L ·N)V (L)
Where Do These Come From?
10
• “Light incident from reflected direction” • “Light incident from refracted direction” • Light going towards the camera
• We’ll recurse and use the same function again
+ ks I(R)+ kt I(T )
kd = diffuse coefficient (“color”)
ks = specular coefficient (“color”)
kt mirror refraction coefficient
+ kd ka ambient lighting
I = kd kl max(0,L · N)I = kd max(0,L ·N)V (L)
Where Do These Come From?
10
• “Light incident from reflected direction” • “Light incident from refracted direction” • Light going towards the camera
• We’ll recurse and use the same function again
+ ks I(R)+ kt I(T )
kd = diffuse coefficient (“color”)
ks = specular coefficient (“color”)
kt mirror refraction coefficient
+ kd ka ambient lighting
I = kd kl max(0,L · N)I = kd max(0,L ·N)V (L)
What Does It Look Like?
11
Turner Whitted
Good Read!
12
Turner Whitted thinks back to the days of his discovery
What Does It Look Like?
13
Simple NVIDIA Optix sample