February 2019
Intermediate to advanced
292 pages
6h 55m
English
Another feature of point lights is that they shine equally in every direction. But it can be fun to break that assumption and have your lights focus on a particular point. The result is a spotlight, like this:

To make this work, assign your light a direction and an angle that describes the beam’s width. Then, any point that falls outside the light’s cone is considered to be in shadow. If you want the beam to have a soft boundary, you can define a second “fade” angle, inside of which the beam blends from full intensity to none.
Implementing Spotlights | |
|---|---|
|
Remember, the dot product of two unit vectors is the same as the cosine of the angle ... | |
Read now
Unlock full access