## Goals

• Cast rays to determine which areas are shadowed

In this project, we will cast shadow rays from the points of intersection when calculating the Phong shading.

## Cast shadow rays at each intersection point

Whenever a ray intersects an object at point a point vec bbp, loop through each light in the scene and construct a new ray with the following parameters:

• An origin of vec bbp.
• A direction of vec bbL - vec bbp, where vec bbL is the location of the light.

For each shadow ray, loop through all the objects in the scene except the current one (the one with the interesection we're trying to shade). If the shadow ray intersects any of these objects with 0 < t < 1, the original intersection point is in shadow from the corresponding light.