February 2019
Intermediate to advanced
292 pages
6h 55m
English
Given some point, you can know that it lies in shadow if there is another object sitting between it and the light source, as shown in the following figure.

The light source is unable to contribute anything to that point. Take a moment and recall how your lighting function works, from The Phong Reflection Model. The diffuse component relies on the vector to the light source, and the specular component depends on the reflection vector. Since both components have a dependency on the light source, the lighting function should ignore them when the point is in shadow and use only the ambient component.
Add the following test to ...
Read now
Unlock full access