How To Use Light Layers in Unity HDRP

Liberty Depriest
3 min readSep 14, 2022

--

Goal: learn how to use light layers in Unity HDRP

When we have a bunch of cool lighting effects in our scene, our system gets taxed the more objects get illuminated by lights. Here, for example, we have a spotlight that’s shining onto the core, terminal, and floor.

By using light layers, we can “mask” what objects get illuminated. We can make it so that these objects don’t receive the light at all.

To implement light layers, go to your HDRenderPipelineAsset:

And go to the Lighting tab and enable:

And on our spot light, click on the gear icon in General to view the light layer option:

Then you want to make sure that ONLY light layer 1 is selected:

And now we can see that none of our objects is being illuminated by the spotlight:

no light layers vs with light layers

And if we wanted only ONE object to get lit by the spotlight, say our core, we go to the object and go to its rendering layer mask:

And in this huge list, we select the same light layer our spotlight is on.

And there we go!

nothing is lit vs only the core is lit

And that’s all! Thanks for reading, and hope this was helpful! Other than that, have a great game-dev day!

--

--