More Light on Light

Tom Kelliher, CS 320

Apr. 22, 2013

Administrivia

Announcements

Assignment

Read 5.7-5.9.

From Last Time

Introduction to light.

Outline

  1. Derivation of Phong lighting model.

  2. Computing normal vectors.

Coming Up

Incremental final project.

The Phong Reflection Model

  1. Consider an object point, ${\bf p}$ and a light source ${\bf p}_i$.

  2. Important vectors:

    \includegraphics{Figures/phong.eps}

    1. $l$: vector to light source.

    2. $n$: surface normal.

    3. $v$: vector to COP.

    4. $r$: reflection vector.

  3. The light from source to object can be described by:

    \begin{displaymath}
{\bf L}_i = \left[ \begin{array}{rrr}
L_{ira} & L_{iga} & L...
... L_{ibd} \\
L_{irs} & L_{igs} & L_{ibs}
\end{array} \right]
\end{displaymath}

    (theoretically wrong but, in practice, right)

  4. Using material properties, distance from source, orientation of surface and direction of source a reflection matrix can be constructed:

    \begin{displaymath}
{\bf R}_i = \left[ \begin{array}{rrr}
R_{ira} & R_{iga} & R...
... R_{ibd} \\
R_{irs} & R_{igs} & R_{ibs}
\end{array} \right]
\end{displaymath}

  5. (Simplified) Illumination at $\bf p$:

    \begin{displaymath}
I = I_a + I_d + I_s = L_aR_a + L_dR_d + L_sR_s
\end{displaymath}

    A global ambient term may be ``thrown'' in.

Ambient Reflection

Same at each point on a surface:

\begin{displaymath}
I_a = R_a L_a
\end{displaymath}

Repeat for each color.

Diffuse Reflection

  1. Diffuse surface brightest at noon, dimmest at dawn, dusk.

  2. Lambert's law: we see only the vertical component of light:

    \begin{displaymath}
R_d \propto \cos \theta
\end{displaymath}

  3. If $\bf l$ and $\bf n$ are normalized:

    \begin{displaymath}
\cos \theta = {\bf l} \cdot {\bf n}
\end{displaymath}

So:

\begin{displaymath}
I_d = \frac{R_d}{a + bd + cd^2}({\bf l} \cdot {\bf n}) L_d.
\end{displaymath}

Specular Reflection

  1. Specular reflection produces highlights.

  2. The smoother the surface (higher shininess) the narrower the range of reflection angles.

  3. Reflectivity proportional to angle between viewer ($\bf v$) and perfect reflection ($\bf r$):

    \begin{displaymath}
R_d \propto \cos^\alpha \phi,
\end{displaymath}

    where $\alpha$ is the shininess term:
    1. $< 100$ for objects with broad highlights.

    2. 100 to 500 for most metallic objects.

  4. Assuming normalized vectors:

    \begin{displaymath}
I_s = \frac{R_s}{a + bd + cd^2} ({\bf r} \cdot {\bf v})^\alpha L_s
\end{displaymath}

The Phong Model

Computed for each light source and each color:

\begin{displaymath}
I = \frac{1}{a + bd + cd^2}(R_d L_d ({\bf l} \cdot {\bf n}) +
R_s L_s ({\bf r} \cdot {\bf v})^\alpha) + R_a L_a.
\end{displaymath}

Introduction to Computation of Normals

  1. Outward facing normal must be specified for each vertex.

  2. Analytic surfaces: cross product of partial differentials

  3. Polygonal surfaces:
    1. Points of continuity.

    2. Points of discontinuity.



Thomas P. Kelliher 2013-04-21
Tom Kelliher