This lecture will focus on two main concerns when constructing a ray tracer. The first is how to handle illumination, or more precisely, how to compute the color values at pixels by computing the illumination at points on objects in the scene. The second is architecture, or more precisely some tips on the overall design of a ray tracer.

Note that the test of t values for intersections has a floor (min value) of zero. This will turn out to be correct later when we formulate our rays as originating on the image plane (the near clipping plane to use CS 410 terminology). It is not true in the more simplistic development where rays start out at the focal point (FP).

This pseudo code has been changed (2/4/2010 4:40PM) to make the distinction between the recursive and non-recursive aspects of the ray tracer more obvious. Specifically, this formulation supports both recursive reflection and recursive refraction. The later is only form semi-transparent materials and will be discussed later in the semester.

Something seems a little wonky with the pseudocode...should specular highlights get calculated for light sources that are obscured? (Diffuse checks for shadowing, but Specular does not.) Seems like the shadowing check should be promoted from Diffuse to TraceLight?

As often happens, Wikipedia is a fine place to start when looking for more information on a topic.

The eScience Lectures Notes has a wealth of information relevant to graphics in general and ray tracing in particular. The specific link shown in the slides appears to have changed.

Just a note on class timing, this is the first slide for class on Friday January 29th.

R = reflected light ray V = viewer vector Crux of this slide is that you can calculate Phong illumination without determining the reflection vector.
Color of light with specular reflection (Phong illumination) is more influenced by the color of the light source than the color of object. Diffuse/lambertian reflection returns photons more based on the color of the object rather than the color of the light source.
The constant s.Kd() is where the color of the material is defined.

The condition (shadow_surface != s) excludes self shadowing. It may or may not be desired depending on what 'surfaces' are defined as. For things like non-convex shapes or a torus, this would be an error. For small very compact surfaces, this avoids a very low level bug.

The ray is parameterized so that t=0 at the surface pt and t=1 at the light, so if we find an intersection between t=0 and t=1 we know that there's something between the surface and the light.

Note that this slide and the next are an expansion and correction of those originally posted. Changes were also made in some of the earlier slides to better distinguish between Phong shading and recursive reflections.
Ross 2/4/10 4:40PM

Take particular note of the call to TraceLight. Here we see recursion in the basic definition of ray tracing.

As the comment notes, we will want to limit the number of recursive calls we make (number of 'bounces' of the reflected light).

2/5/10 - The call should be to Trace and not to TraceLight.