Search Unity

Progessive Lightmapper Bug? Some lights just disabled after baking.

Discussion in 'Editor & General Support' started by notagame, Sep 19, 2021.

  1. notagame

    notagame

    Joined:
    Sep 17, 2017
    Posts:
    17
    Hi,

    this is truly driving me crazy and I now created a demo scene that reproduces it on a smaller scale. I am using Unity 2021.1 and the scene has maybe 60 spot lights or more plus some point lights and one directional light all set to "Mixed". Most surfaces are marked with "Contribute GI", flowers are market with "Light Probes" to save lightmap space.

    I am using prefabs to construct the level, and these prefabs have lights integrated as needed to support their design. That means all of the lights in the scene are from a small set of prefabs, all using the same settings. However when I bake it with the lightmapper, only 2-3 of them actually emit any light and only 2-3 of them actually are "realtime" lights after the baking. The remaining 50 lights or so are just dead. They emit nothing, even though they come from the same prefab. Moving lights around seems to just cause a randomization, i.e. now different lights work and others don't but the majority still doesn't work.

    Moving the dead lights after the baking does nothing. They stay dead. No setting changes do anything, moving them around does nothing, copy&pasting them produces yet more dead non-realtime lights. But adding new realtime lights works immediately.

    Note that BEFORE baking, these lights all work fine, so it can't be an issue of not supporting all those lights in the realtime portion of unity, technically. Also it seems like the lights get "baked", because of the purple tints everywhere. It's just that they don't become realtime lights afterwards. I guess one possible fix is to duplicate the light and have one set to "baked" and one to "realtime"... But that seems like a very strange fix I would expect "Mixed" to handle lol.

    This is super frustrating tbh. Is this a known issue?
     
    Last edited: Sep 19, 2021
  2. notagame

    notagame

    Joined:
    Sep 17, 2017
    Posts:
    17


    This demonstrates the issue. All these elements are the same prefab. They all have the same light. But only 2-3 of them are working after baking.
     
  3. notagame

    notagame

    Joined:
    Sep 17, 2017
    Posts:
    17


    So this is with doubling the intensity of baked lights and setting all lights to "Baked" instead of "mixed". This is how it should look like above. Now I added a realtime light to each baked light and set their culling mask to "Dynamic Objects", which is a layer that will only contain mesh renderers that are not marked as "static", therefore excluded from baking, and can still receive dynamic lighting.

    This is all super convoluted. Not only do you need to use different settings from baked vs. realtime, but also you need to manually manage which objects are affected by realtime vs. baked light.

    Either I am missing something obvious here or unity once again opts for letting the customer solve the difficult problems.