Ray Casting and Ray Tracing



To this point we have adopted a "feed-forward" or "forward-mappping" approach to rendering. Just what do I mean by feed-forward?

There is an alternative approach in which at at pixel we traverse to display list. This approach is called "feed-backward" or "inverse-mapping".

This class of rendering algorithms is called "Ray casting". In a ray-casting renderer the following process takes place.

  1. For each "Screen-space" pixel compute the equation of the "Viewing-space" ray.
  2. For each object in the display-list compute the intersection of the given ray
  3. Find the closest intersection if there is one
  4. Illuminate the point of intersection

Many parts of this process should already be somewhat familiar to you. For instance the process of computing the equation of a ray given a screen space coordinate is exactly the inverse of the modeling transform discussed in previous lectures. Thus we can compute a viewing tranformation that will look something like:

And the direction of the ray can be computed using the inverse of the upper 3x3 matrix.

Actually, it is more straightforward to rederive this expression from first principles using the eye point, the look-at point, and the up vector as before, but the result would be identical.

The equation of the resulting ray would be:

The second step is to intersect this ray with our primitives. Lets consider a sphere. As you know the geometry of a sphere is defined by it center and its radius.



The source. The scene file.
This page last modified on Monday, November 25, 1996