Search Unity

Some mixed lights are not GI/baked correctly

Discussion in 'Global Illumination' started by Tech-Labs, Jan 16, 2020.

  1. Tech-Labs

    Tech-Labs

    Joined:
    Feb 5, 2014
    Posts:
    105
    Okay, I've got a neighbourhood scene with about 50 (street/road)lights. I've opted for Area (rect) lights as they seem to produce the best lighting in this setting. I want to try to make all my lights Mixed to start with (running on a large desktop system, so for the time being it's okay).
    I'm running 2019.16f1, with HDRP. Everything looks fine and runs fine.
    I'm trying to do both Realtime GI and baked (shadowmask - low settings to test) lightmaps as I want the best of both worlds.

    However, of my 27 road lights (simple high placed area lights that shine downwards) 5 do not lightmap correctly. That is, after baking, when I turn off all these lights, 5 of them remain lit and do not cast real time shadows. The other lights look fine and work fine.
    When I make change to a light or redo that light, that one may be fixed, but another close by will go wrong. When I disable the 5 offending lights and rerun the baking, it looks good. Replace those 5 with new ones, again those 5 or 5 others do not work as they should.
    Restarted Unity and Windows. Clean the baked maps a hundred times. Checked the max lights in the HDRP settings (no problems there).

    No clue as to why this may happen.

    Any ideas??
     
  2. rasmusn

    rasmusn

    Unity Technologies

    Joined:
    Nov 23, 2017
    Posts:
    103
    A wild guess: Maybe your issue stems from the fact that Unity can only store shadowmasks for up to 4 overlapping lights? If there are more than 4 overlapping lights for a surface, the additional lights will fallback to be regular baked lights.

    Maybe this explain why your 5 lights remain lit when you disable them (they are actually regular baked lights and thus baked into the lightmap, due to the above mentioned limitation).

    You can read more about this limitation here. You can debug this using the Light Overlap debug visualization, as described here.

    If my guess is not helpful, I recommend you post a few screenshots that explain the problem. This makes it much easier to understand your scene, setup, and problems, and thus also to help you.
     
  3. Tech-Labs

    Tech-Labs

    Joined:
    Feb 5, 2014
    Posts:
    105
    Yes! Thanks. That was the problem indeed! Didn't know about that limitation.
    Cheers!
     
    rasmusn likes this.
  4. ggamerz61

    ggamerz61

    Joined:
    Apr 19, 2020
    Posts:
    2
    Hi, have you fixed the problem yet? because I have the exact same problem. If yes, can you tell me how?
     
  5. instruct9r

    instruct9r

    Joined:
    Aug 1, 2012
    Posts:
    148
    Hey @rasmusn we do understand that there is a limitation, but what happens if we need more Mixed lights? Why is Unity just limiting something without an option to increase it. I have a scene with 6 lights that needs to be mixed, because they turn off and on and if i understand correctly there is no way to achieve that...