CSU540 Computer Graphics - Fall 2005 - Futrelle - Final Semester Programming Assignment #3 (SP3)
Shadows -- Professor Futrelle
DUE 11:59 PM, WEDNESDAY, DECEMBER 7th, 2005
Version of 7 December 2005
See note at end about a simple two-triangle shadow test. 12/7/05.
You can use your SP2 model
The assignment, SP3:
- The goal is to produce shadows in your scene.
- For each ray, if you get a hit on any triangles,
use the closest triangle hit point, the visible triangle for that ray,
as a new eyepoint, e' and form
a new ray of the form e' + tL,
where L is in the direction of the light source.
- If your new ray hits any triangle at all, then the
point e' can't "see" the light source and is therefore
in a shadow.
- Every point in a shadow should be illuminated only
with ambient light. If not in a shadow, with the light source plus ambient.
- One slight cautionary note: Because of round-off,
your new ray may appear to hit the surface that you hit
with your initial ray. You can guard against this by
setting e' = e' + epsilon x n,
for some small epsilon that separates e' by at least a few pixels from
the surface - with n being the normal to the triangle.
After this adjustment it is still legitimate for the new
ray to hit the triangle it's starting from. A surface can shadow itself.
This self shadowing is also signaled by the negative n•L inner product.
- Make sketches of different possibilities to assure yourself that you
understand what's going on.
That's all there is to it. Do the above, and shadows will appear.
Below is a figure that illustrates the simplest possible shadowing
situation - one triangle shading one other triangle. This might help
you to get your code designed and working properly.
Go to CSU540 home page.
or RPF's Teaching Gateway or
homepage