Using Cookies for Realistic Lighting

As delicious as it sounds, and unlike those pesky internet cookies — cookies in Unity act as a mask (or gobo for my fellow entertainment industry peeps), that are placed on a light source to create shadows. These can either be used for special effects, or to mimic real life fixture attributes, whilst using very little runtime resources.
To add a cookie, we first need an appropriate texture. These images need to be greyscale, and a quick google can provide many different free images

Adding one of these images to our project folder allows us to set it up as a cookie texture. To do so, we need to change the Texture Type and apply, although in the High Definition Rendering Pipeline, cookies are actually handled as default texture types. We also want to make sure our Alpha Source is set to From Gray Scale.
Within our Light component, we can now drag and drop our Cookie to see it take effect!

What is also worth noting, is how different light types interact. A Spotlight will handle the cookie texture as expected, but Point lights disperse light in all directions, therefore we need to set the cookie texture’s type to convert it into a Cubemap.
As for Directional lights, they can use either type, but will interact differently. A spotlight cookie will have the texture appear once in the direct path, whereas a point light cookie will repeat the texture in a tiled pattern across the scene.
