# Project 4: Rendering shadows

## 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.

These are the shadow rays.

## Determine if a sphere is in shadow from a 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.

If a point on a sphere is in shadow from a particular light, don't include the diffuse and specular terms of the Phong illumination model *for that light*. Continue including contributions from any lights that are not blocked by other objects.