Search Unity

Question Why do so many lights stop working in unity?

Discussion in 'High Definition Render Pipeline' started by Homicide, Nov 1, 2022.

  1. Homicide

    Homicide

    Joined:
    Oct 11, 2012
    Posts:
    657
    Hello everyone. Something I have struggled with for a long time now, I hope someone can shed come light for me. hehe, Shed some light...

    I am also not sure this is even the right category of forum for this, as it is not just an HDRP thing. See below.

    Anyways, it seems no matter what i do, i always run into lights not working. I set up my scenes, the lights work when first set up, but, when i come back to the scenes after saving, baking, play testing etc, and even in play mode, it seems so many lights are just broken.

    To be specific, i populate a race track with many track lights, generally varieties of spot lights, from Box, to Cone, always set to mixed lighting. I have also configured every fade out option to be very low. But none of this seems to matter, as in the end, most of them do not work it seems. I can toggle the lights on off, turn up the brightness, etc, they are literally dead and do nothing. Where as others are working just fine. Only one of 5 (random numbers here as thats what it does.) will have volume fog around it, many dont even seem to emit light at all anymore.

    This is not unique to my version, or even HDRP, as i have experiences this for quite literally years, although- always to busy on other parts of a project to chase the problem. Now, i have a nearly completed game, short of basically just the VFX / FX. But this issue is now bothering me alot.

    I will happily provide more info, or demonstrate on video / discord, whatever, if anyone has any tips , pointers, advice. I'm all ears. Ty.
     
  2. akent99

    akent99

    Joined:
    Jan 14, 2018
    Posts:
    588
    I don't have answers, am not an expert, but I have found there are limits that when exceeded, it is unpredictable what will happen. E.g. it is random which lights / shadows of lights will get dropped, so you can come back later and its different. As I find issues and tools, I have been adding them to the end of a blog where I am keeping my own HDRP lighting notes if any use https://extra-ordinary.tv/2022/09/25/lighting-tricks-in-unity-hdrp-for-cinematic-effect/ - e.g. towards the end there are some tools to check number of lights per tile - if the limit is exceeded, strange things can happen (but not always).
     
    Homicide likes this.
  3. Homicide

    Homicide

    Joined:
    Oct 11, 2012
    Posts:
    657
    Well if nothing else, i did learn something new. Render Debuger. Nice, thanks mate, i will read through that.
     
  4. pierred_unity

    pierred_unity

    Unity Technologies

    Joined:
    May 25, 2018
    Posts:
    433
    The baking mode you picked (for instance Shadowmask) could be the culprit.

    https://docs.unity3d.com/Manual/LightModes.html

    If you would rather use "Baked Indirect" in the lighting window, you should not have any trouble at all, as there is no max number of light in this mode (unlike Shadowmask limited at 4 lights per texel).

    From the doc:
    https://docs.unity3d.com/Manual/LightMode-Mixed-Shadowmask.html
     
    ebaender and Homicide like this.
  5. Homicide

    Homicide

    Joined:
    Oct 11, 2012
    Posts:
    657
    Thank you sir, i shall attempt to look into this further. Appreciated.

    UPDATED: With only a little time put in to testing and correcting my lights, it seems this information here is key to what i have missing all this time. To much codin' not enough anything else. Im sure i will run across issues, but this seems to be 'the' starting point.

    Thanks again mate.
     
    Last edited: Nov 1, 2022