CS488 - Introduction to Computer Graphics - Lecture 10

Public Service Announcements

  1. Assignment 3 due 18 June, one week from today.
  2. PDF that covers colour

Lambertian Surfaces

Model of body reflection

How much light hits the surface?

  1. Idealize light sources as points emitting light
    1. How much light does a source emit?
    2. How much light is there at a distance r from the source?
      • Segregate the light by direction
      • How much light per unit angle?
    3. How much light per square metre?
      • Falls off with distance.
      • How? Think how big the surface of a sphere is.
    4. How much of the surface does a square metre of the sphere cover?
      • Depends on the angle
      • How?
  2. What if the lights were (infinite) lines?
  3. What if the lights were (infinite) planes?
  4. What do we do in practice?

Comment. Two general aspects of the above are very important to getting things right in computer graphics

  1. The scaling arguments from dimensionality
  2. The geometric derivations of angular facts from small areas

How much light leaves the surface?

This material is described with diagrams here.

We are only interested in the light leaving the surface in a particular direction. Why?

The light divides into two parts at the surface

The simplest model of body reflectance is Lambert's cosine law. Surfaces with body reflectance following Lambert's cosine law are called Lambertian.

What makes a Lambertian surface Lambertian?

What goes into the eye

Important point

What colour is the light?


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: