Search Unity

Stop Directional Light from affecting indoor rooms?

Discussion in 'Editor & General Support' started by FlorianHoll, Jan 16, 2020.

  1. FlorianHoll

    FlorianHoll

    Joined:
    Oct 9, 2019
    Posts:
    2
    Hi there,

    I'm working on a game that features a seamless world where you walk into dungeons without any loading screens etc with the hdrp.

    I'm currently using a directional light as a sun to light up the overworld, but for some reason, the light keeps bleeding into indoor sections like dungeons.

    This is the dungeon with the directional light disabled:
    nolight.JPG
    And with the light enabled: light.JPG






    Is there some way to make the directional light only affect outside areas like a sun?

    (I've tried to set the walls to cast two-sided shadows but that didn't change anything)
     
  2. Exeneva

    Exeneva

    Joined:
    Dec 7, 2013
    Posts:
    432
    I'm also curious about this.
     
  3. FlorianHoll

    FlorianHoll

    Joined:
    Oct 9, 2019
    Posts:
    2
    Hi,
    I managed to fix this problem by turning down the ambient occlusion value of my materials to 0. You can even see that the corridors in my screenshots have correct AO values, while the ones for walls are too high. Hope that helps :)
     
    trombonaut and Phil_42 like this.
  4. Smith_076

    Smith_076

    Joined:
    Feb 6, 2020
    Posts:
    17
    Do i need to have an AO map and then set it to 0 ? cos I am in a similar situation and it doesn't seem to be working? Anyone knows why this happens?
     
  5. Smith_076

    Smith_076

    Joined:
    Feb 6, 2020
    Posts:
    17
    My workaround for this was to use light layers, i set the lights in my underground level to a specific light layer and then set the rendering layer mask in the mesh renderers as the same light layer as earlier. I use light layer 7 for both.