Creating a Shadow VFX Using the Occlusion Map Property in Unity

Occlusion property

Rusben Guzman
2 min readSep 28, 2021

Objective: create a material and modify the occlusion value to give a shadow effect to the door.

The occlusion map is used to provide information about which areas of the model should receive high or low indirect lighting.

In this example I have a door model in a plain white, the idea is make it look like the other door next to it. So the first step was to create a material with the respective texture and add it to the door.

In order to use the occlusion map we have to provide a black and white version of the texture. The black part of the image tells unity what part of the model is not going to receive light creating the shadow effect and the white part of the image the opposite, just representing the part that receives light directly.

Once we know that we only have to add the image to the occlusion property in the inspector.

Then after we add the image we can change the value of the occlusion.

And that’s it!!! You can experiment with the value until you get the perfect fit for your game.

--

--

Rusben Guzman

A Software Engineer passionate about game dev and interactive products with Unity. I consider video games to be the artistic expression of programming.