As your experience controlling the many light sources in Unity grows it will become pretty clear that their ability to cast particular kinds of shadows comes with some serious limitations. This is especially true if you want to maintain performance or have more unique shadow casting such as ripples of water or mesh grid shadows. The simple way to do this is with light masks better known as (this originated from the term cucoloris which casts silhouetted illumination in film and theater) cookies.
Let’s start by using the texture I have provided below, just import this into your existing project.This is almost a pixelated style light source like a light shining through a plastic or glass prism. Good for maybe a retro-styled light.
Once imported, create a spotlight and up the light intensity, this will be good to show the cookie in action.
Next we’ll edit the image we imported. The key things we’re changing are changing the Alpha Source to From Gray Scale so that the image will be transparent based on the black/white values of the image, and setting the Alpha Is Transparency so that it appears as transparent. The rest you can leave default.
Next we’ll add the modified cookie to the spotlight itself under the Light component.
Now we can see the cookie applied to the spotlight. It’s a subtle cookie but it’s definitely there.
This really illustrates the versatility of light cookies for adapting your existing lights to be more immersive and interesting as well as helping sell the vision of the game you’re looking to create. Until next time, happy coding.