- Home /
Ignore all lighting except for one (HDRP)
How to ignore all lighting on material/object except for one?
To be more precisly i have:
Main Cube size (1,1,1) with children:
Child Cube size(1.1f, 1.1f, 1.1f) (transparent emissive material)
Spot Light set to (0, 0, -1) to Main Cube world position
Player Spot Light that can be looked at the Main Cube
but this is where the question comes in, how to ignore Player Spot Light on Child Cube but still recieve Cube Spot Light?
EDIT: I am using HDRP
Answer by Adamala · Jan 15 at 06:58 PM
To do so in 3D (HDRP) in Mesh Renderer at very bottom is option called Rendering Layer Mask
This has to be changed to different one (make sure that the others layers are uncheked)
Then in Light in General there are little three dots (options) then select "show additional properties"
So it will show Light Layer option, this option needs to be changed to Renderer Layer changed previously (again make sure that the other layers are uncheked)
Thanks to Beacom
Answer by Beacom · Jan 15 at 05:54 PM
3D
A 3D light has a Culling Mask property. You can adjust that to specify which layers a light illuminates. It is then a matter of assigning your visible game objects the correct layers for which lights you want to illuminate them.
2D
In 2D projects, a similar effect can be achieved using Sorting Layers on 2D lights.
Oh yes you are right, thank you for that, but I didn't said that I am using HDRP (simply I didn't know about there would be a difference) that option seems to be missing there
Ah, you've got me there. I haven't gotten around to working with HDRP yet.