Creating and applying a cookie texture to a spotlight
Lights can have a cookie Texture applied. “Cookies” are Textures used to cast shadows or silhouettes in a scene. They are produced by using the cookie Texture as a mask between the light source the surfaces being rendered. Their name, and usage, comes from physical devices called cucoloris (nicknamed cookies) used in theatre and movie productions to create shadow effects implying environments such as moving clouds, the bars of a prison window, or the sunlight broken up by a jungle leaf canopy, for example. Cookie Textures can work well with Unity SpotLights to simulate shadows for these effects as well.
In this recipe, we’ll create and apply a cookie Texture suitable for use with a Unity SpotLight.
Figure 13.46: Cookie Texture as shadows thrown by a SpotLight
Getting ready
If you don’t have access to an image editor, or prefer to skip the Texture map elaboration in order to focus...