CS488 - Introduction to Computer Graphics - Lecture 22

Ray Tracing

Transforming Surface Normals

The tangent plane (space)

Implicit surfaces, i.e., given by f(Q) = 0.

Calculating the tangent plane in practice



  1. Choose two points, Q1 & Q2, slighty away from Q in different directions
  2. The points must lie on the surface: f(Q1) = f(Q2) = 0
  3. The plane spanned by Q-Q1 and Q-Q2 is an approximation to the tangent plane

The normal vector

The normal vector is the outward facing unit vector perpendicular to the tangent plane.

It is defined by

  1. |n| = 1
  2. n \dot t1 = 0
  3. n \dot t2 = 0

t1 & t2 can be the vectors Q-Q1 & Q-Q2.

In practice

  1. 2 & 3 are linear equations
  2. Solve them up to a constant
  3. Use 1 to set the overall normalization


Transforming the normal vector

  1. Under an affine transformation, M, Q goes to MQ, and Q' goes to MQ'.
  2. The new tangent, n1, is defined by n1.M(Q'-Q) = 0.
  3. u \dot Mv = 0 if and only if inv(transposeM)u \dot v = 0.
  4. Therefore n' = inv(transposeM)n is the transformed normal vector.

Most of the time this doesn't matter, but ...

Speeding Up Intersection Tests

  1. Bounding Volumes (usually Boxes)
    1. Find the smallest - or close to smallest - regular volume that encloses the object
    2. Use ray-intersect-volume as a pretest for fast negative results.
    3. Trade-off between
      • benefit of quicker `miss'detection
      • cost of getting a good bounding surface
      • Both increase as complexity of primitive increases

    Scene subdision

    1. Divide the scene volume into sub-volumes: many ways to do it, such as
      • quad-trees
      • oct-trees
      • BSP trees
      • ...
    2. List all primitives by sub-volume.
    3. Only test primitives in the sub-volumes through which a ray passes.
  1. Solid Textures
    1. Solution to mapping texture onto curved surfaces
    2. Usually procedural


Two different, but linked, types of artifacts

  1. Spatial (or temporal) frequency aliasing,
  2. Reconstruction aliasing

Exact solutions are simple in principle

  1. Remove high spatial frquencies by filtering
    1. Fourier transform in image space: remember that you need to keep both amplitude and phase.
    2. Filter
    3. Inverse transform in image space

    Filtering is the tricky part.

  2. Use a sampling filter that is the inverse of the reconstruction filter
    1. For the display to be used find the pixel shape
    2. Construct a sampling filter appropriate for the pixel shape
    3. Do ray-tracing calculating over a weighted area

    Finding the pixel shape is the hard part.

In practice

  1. Beam tracing
  2. Super-sampling
  3. Stochastic super-sampling


Constructive Solid Geometry (CSG)

Geometric primitives can make other geometric primitives by

  1. union
  2. intersection
  3. subtraction

The result is like sculpting; the problem is that describing the result is very difficult; the solution is

Texture Mapping

  1. Basic
    1. Start with a 2D image: pixellated or procedural
    2. Map 2D image onto primitive using a 2D affine transformation
      • Simple if the surface of the primitive is flat
      • otherwise, ...
    3. Backwards map intersection point with ray into the image to get the surface properties
  2. Normal Mapping (Bump mapping)
    1. Start with a difference surface, defined with respect to the surface
    2. Calculate the normals to the difference surface and map them onto the surface of the primitive
    3. Use the mapped surface models for lighting
    4. No occlusion, shadows are wrong, silhouettes are wrong, nobody notices!
  3. Solid Textures
    1. Solution to mapping texture onto curved surfaces
    2. Usually procedural

Return to: