Control Your Lighting in Unity Using Light Layers!
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.
Set your location and if you want to follow along exactly, I set the intensity to 1000 and increased the inner and outer range.
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.
Select the spotlight, select the options button under general tab.
Set light layer to nothing, then set light layer to Layer 1.
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.
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.
Now we have these volumetric spotlights that are illuminating our environment without actually generating a light source!