CS488 - Introduction to Computer Graphics - Lecture 21

Comments and Questions


Review

  1. Shading


Ray Tracing

The idea is simple:

for each pixel
  calculate the eye/pixel ray
  project the ray into the scene
  find the first intersection
  apply illumination and shading calculations
  colour the pixel with the result

Eye-pixel ray

E + t*(P - E)

Object in scene

Set of points {Q} satisfying

Solve the equation

The surface might be defined by an algorithm, then use a root-finding method

Object is planar, e.g. a triangle

Equation of the plane is \sum_i ai*xi = b. Where do the parameters come from?

Substitute eye ray into the plane equation and solve for t

Another idea: intersect in object coordinates


Shading for Ray Tracing

When we have found the intersection point we need to calculate a colour.

We know

  1. The eye ray, V
  2. Surface properties
  3. The normal vector

For each light

  1. Calculate illumination: RGB, l

    Accumulate outgoing light

How about shadows?

How about reflection?


Return to: