Search Unity

Why is a directional light affecting a layer it should be restricted from?

Discussion in 'Global Illumination' started by Reverend-Speed, May 15, 2019.

  1. Reverend-Speed

    Reverend-Speed

    Joined:
    Mar 28, 2011
    Posts:
    284
    Hey folks. Sorry to bother you again, but my struggles with Unity's lighting continues apace.

    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
     
  2. kristijonas_unity

    kristijonas_unity

    Unity Technologies

    Joined:
    Feb 8, 2018
    Posts:
    1,080
  3. Reverend-Speed

    Reverend-Speed

    Joined:
    Mar 28, 2011
    Posts:
    284
    Thank you again, @kristijonas_unity . To be clear, I'm hoping to make the warp near instantaneous, but that does look like exactly what I want.