- Home /
Why is a directional light affecting a layer it should be restricted from?
I have a game design which requires warping between two worlds, lit in different ways.
I've used two Directional Lights (SLight and FLight) and two layers, which we'll call SLayer and FLayer. SLight's culling mask is set to not interact with FLayer, and FLight's culling mask is set not to interact with SLayer. Both are set to Mixed mode, casting Soft Shadows.
I bake my lighting with full GI & Realtime GI, which completes satisfactorily.
Unfortunately, warm, orange-ish lighting from FLight (of the left of the screen) is also displaying on the SLayer on the right of the screen. Disabling FLight stops the orange-ish lighting on the right of the screen, so presumably the effect is related to realtime lighting.
Can anybody suggest how to ensure lighting from a directional light is confined to a particular layer?
I'm happy to provide a package with these assets and scene if somebody things that it would help them diagnose the problem. Thanks in advance, folks.
--Rev
Answer by Reverend-Speed · May 15, 2019 at 09:15 PM
As advised by Unity experts, additive scene lighting seems like the better way to accomplish this effect. See this example project.
Thank you to kristijonas_unity for this solution.