Control Your Lighting in Unity Using Light Layers- Game Dev Series 164

S.J. Jason Liu
3 min readJun 6, 2022

Objective: using light layers to create an efficient light using in game scene.

Since last article we created fog in game scene, the best way to improve the atmosphere is adding some light. I’ve add some light in it but its too much to a simple game scene, especially when your game scene is getting bigger, you would never want these lights would slow down the performance of your game.
With this situation, light layers would be a good way to lower the cost on game performance and also improve the vibe.

Enable light layers

Before we adjust the light with layers, it shows hard light reflecting on objects.

But we would simply need those light spots to emphasize the fog in scene, not cover up the whole place with strong white light.
First thing we need to do is select the HDRP asset to make a basic adjustment.

Under the section of Lighting, drop down Light Layers and click Enable.

Once checked, we can back to our light in scene to make some changes on them.

From nothing to layer

Select the lights and check the Inspector, there should be a cog icon under General drop down menu.

Click it and you should see the option of Light Layers pops out.
First we need to choose the layer to Nothing, that would disable all the reflection in game scene on objects. You should see the result immediately.

Then select any layer you wish in the list, except Everything. In my case, I choose Light Layer 1.

Now you light would no longer affect the objects in scene but provides a good way to enlighten the whole game scene with better vibe.

Compare the result before and after enable light layers in scene.

--

--

S.J. Jason Liu

A passionate gamer whose goal is to work in video game development.