Using Cookies to Create Realistic Lighting

Andrea Alicino
2 min readOct 17, 2022

--

Achieving the right lighting in Unity takes time and you have to work on the details.

Today I want to talk about Cookies a pretty good little tool to give the right upgrade to the look of the game.

What is a Cookie?

For this definition, I refer you directly to the Unity documentation.

A cookie is a mask that you place on a Light to create a shadow with a specific shape or color, which changes the appearance and intensity of the Light. Cookies are an efficient way of simulating complex lighting effects with minimal or no runtime performance impact. Effects you can simulate with cookies include caustics, soft shadows, and light shapes.

Let’s move on to implementation

to realize this effect we need a texture, obviously searching only cookies on google images you will not find what you are looking for. Enter Unity in the search words to improve the result.

Once we find an image, we insert it into the project.
We need to prepare the image, as we do for sprites but this time we select the cookie item from the drop-down menu.

Let’s go to the game scene, and create a spotlight, we will notice that in the emission section we will have a space just for the cookie we created.
Let’s insert the texture and point the light at a surface.

Perfect.

I hope you found this article useful.
See you in the next article🚀.

--

--

Andrea Alicino
Andrea Alicino

Written by Andrea Alicino

Game Developer Unreal Engine/Unity. Computer science graduate. Seeking new opportunities.

No responses yet