CS488 - Introduction to Computer Graphics - Lecture 18


Highlights

Part of the light didn't enter the body of the surface, but was reflected

Suppose the surface is smooth

Suppose we roughen the surface just a little

And if we roughen the surface a lot

Here is the hack

How is the incoming light divided between ambient, surface and body reflection?

L(\lambda) = Ia * ka(\lambda) + Id * ( l \dot n ) * kd(\lambda) + Is * ( s \dot e )^p * ks


Shading

Terminology

  1. Psychologist: shading
  2. Artist: shading
  3. Utah-graphics: shading
  4. Renderman: shader
  5. GPU: shaders

We are doing Utah-graphics


Flat Shading

Shade entire polygon one colour


Gouraud Shading

Calculate at vertices and interpolate linearly

Interpolating within triangles

  1. Barycentric coordinates
  2. For practical interpolation we care about P -> P + v
  3. C(P) = a1 * C(V1) + ...
  4. The calculations are affine-invariant, so you could

    BUT, the calculations are NOT projection-invariant

Interpolating within arbitrary polygons is a bad idea

What's wrong with Goraud shading?


Phong Shading

Interpolate the vertex normals, light vectors, and view vectors

Highlights are more precise


Return to: