Sitemap

Control Your Lighting in Unity Using Light Layers!

3 min readJun 28, 2022

Objective: Illuminate your environment without generating a light source!

What if you want to use volumetric fog, but you don’t want an actual light source that is generating lumens and illuminating your scene? That’s when Light Layers come in.

Using Light Layers allows you to set a light source to cast on only certain objects on a certain layer. If there are no objects on that layer, the light will not cast. This is great for optimization and for these volumetric effects.

Let’s begin with creating a spotlight.

Press enter or click to view image in full size

Set your location and if you want to follow along exactly, I set the intensity to 1000 and increased the inner and outer range.

Press enter or click to view image in full size

Now, how do you turn on turn on light layers? Select the setting folder in the project view > HDRenderPipelineAsset.

On the inspector, enable the light layers.

Press enter or click to view image in full size

Select the spotlight, select the options button under general tab.

Press enter or click to view image in full size

Set light layer to nothing, then set light layer to Layer 1.

Press enter or click to view image in full size

Now you can drag the light around the environment, and it is not going to cast a light onto the scene, but it’s going to have the light effect.

Press enter or click to view image in full size

Now I increased the intensity to 20,000. I also adjusted the range, so it is not too close to the source. Also give the light a green tint to match the fog.

Press enter or click to view image in full size

Now we have these volumetric spotlights that are illuminating our environment without actually generating a light source!

Press enter or click to view image in full size

--

--

No responses yet