up to Schedule & Notes

Phong Illumination Model

The Phong model is a description of how light interacts with a surface.

Many illumination models exist. Phong is easy to implement and gives reasonable results at little computational cost.

The Phong model has four components:

Diffuse Reflection

Diffuse reflection consists of light that is reflected equally in all directsions. Below, the length of the reflected ray is in proportion to its intensity.

As incoming light becomes more horizontal, it gets spread out across more of the surface. So its reflection becomes dimmer.

The arriving irradiance (what we think of as "intensity") is $I_\textrm{in} = {P \over x}$ for power $P$ and cross-sectional area $x$. This is measured in Watts/$m^2$.

But that same power, $P$, gets spread out over a surface area $x'$. So the intensity of the surface is ${P \over x'}$. That is what the eye sees as $I_\textrm{out}$.

$\begin{array}{rl} I_\textrm{out} & = \displaystyle {P \over x'} \\ & = \displaystyle {P \over ( {x \over \cos\theta} ) } \\ & = \displaystyle {P \over x} \cos\theta \\ & = \displaystyle I_\textrm{in} \cos\theta \end{array}$

For diffuse reflection, the Phong model states that

$I_\textrm{out} = \cos\theta \; I_\textrm{in}$,

where $I_\textrm{in}$ and $I_\textrm{out}$ are the incoming and outgoing light intensities, respectively. Diffuse reflection doesn't change with the outgoing direction.

Specular Reflection

Specular reflection is mirror-like and has maximum intensity in the ideal reflection direction. Below, the length of the reflected ray is in proportion to its intensity.

The relevant directions (as unit vectors) are

For specular reflection, the Phong model states that

$I_\textrm{out} = (\cos\Phi)^n \; I_\textrm{in}$,

for light coming in from $L$ and leaving toward $V$.

For $\Phi$ equal to the angle between $R$ and $V$, and $n$ an arbitrary exponent (usually in the range 50 to 400), here's what $(\cos\Phi)^n$ looks like.

With higher exponents $n$, there's a faster dropoff in $(\cos\Phi)^n$. So the light dims more quickly as $\Phi$ increases. In other words, the light dims more quickly as $V$ moves away from $R$.

Specular reflection appears as a soft spot on the surface. The spot gets narrower as $n$ increases.

Ambient Reflection

Ambient reflection is a hack to light up surfaces that are not lit directly. "Ambient" suggests that there's a bit of light everywhere.

Emissive Light

Emissive light originates from the surface.

All of the Components

The directions are

Note that

The intensities are

The reflection coefficients are

Note that $I_\textrm{E}$, $k_D$, $k_S$, $k_A$, and $n$ are surface properties. A surface will appear different when these are changed. In particular,

The Phong Model

$\begin{array}{rl} I_\textrm{out} = & k_D \; N \cdot L \; I_\textrm{in} \\ & + \; k_S \; (R \cdot V)^n \; I_\textrm{in} \\ & + \; k_A \; I_A \\ & + \; I_E \end{array}$

Some Notes

  1. Diffuse reflection multiplies the light colour, $I_\textrm{in}$, by the surface colour, $k_D$. This is done component-wise. For $I_\textrm{in} = (r_i,\;g_i,\;b_i)$ and $k_D = (r_d, \; g_d, \; b_d)$ the product is
    $k_D \; I_\textrm{in} = (r_d \: r_i, \; g_d \: g_i, \; b_d \: b_i)$
  2. Specular reflection always shows the light colour, meaning that if $k_S = (r_s,\;g_s,\;b_s)$ then
    $r_s = g_s = b_s$.

How to Compute $R$

$R = 2 \; (N \cdot L) \; N - L$

up to Schedule & Notes