Lighting and Shading
Lighting and Shading
Lighting and Shading
l = r
Non-Ideal Specular Reflectance
Snell’s law applies to perfect mirror-like surfaces, but
aside from mirrors (and chrome) few surfaces exhibit
perfect specularity
How can we capture the “softer” reflections of surface that
are glossy rather than mirror-like?
One option: model the microgeometry of the surface and
explicitly bounce rays off of it
Or…
Non-Ideal Specular Reflectance: An Empirical
Approximation
In general, we expect most reflected light to travel in the
direction predicted by Snell’s Law
But because of microscopic surface variations, some light
may be reflected in a direction slightly off the ideal
reflected ray
As the angle from the ideal reflected ray increases, we
expect less light to be reflected
Non-Ideal Specular Reflectance: An Empirical
Approximation
An illustration of this angular falloff:
Ispecular ksIlightcos
nshiny
Ispecular ksIlight Vˆ Rˆ nshiny
Rˆ 2 Nˆ Lˆ Nˆ Lˆ
Calculating The R Vector
Rˆ 2 Nˆ Lˆ Nˆ Lˆ
This is illustrated below:
Rˆ Lˆ 2 Nˆ Lˆ Nˆ
Phong Examples
These spheres illustrate the Phong model as L and nshiny
are varied:
The Phong Lighting Model
Our final empirically-motivated model for the
illumination at a surface includes ambient, diffuse, and
specular components:
#lights
I i kd Nˆ Lˆ k s Vˆ Rˆ
nshiny
I total ka I ambient
i 1
# lights
nshiny
Itotal ke I a ka I d kd Nˆ Lˆ I s ks Vˆ Rˆ
i 1