Search Unity

Question Issues with lightmapping - Changing point light range has no effect on lightmap

Discussion in 'Global Illumination' started by sdadamd59, Sep 7, 2022.

  1. sdadamd59

    sdadamd59

    Joined:
    Nov 5, 2018
    Posts:
    4
    Hello! I'm having some trouble getting the lightmapping in my scene to work.

    I have point lights that are set to baked mode, but when I bake the lightmaps, they are very dim. Increasing the intensity helps a little bit, but I'm finding I have to pump it up quite a bit to see it. Weirdly, increasing the value (even by a lot) has NO effect on the scene. Of course, changing the mode of the light from baked to mixed makes it incredibly bright. But I can't figure out why the range is having no impact in baked mode.



    Additionally, I've tried clearing the GI Cache, but that seems to completely delete the lightmaps, and makes all the lights behave like mixed lights until I generate a new lightmap (ie, when I move them around, the lights change in real time, even though the mode is still set to baked.)

    Hopefully this isn't a bug and I'm just missing something simple. Any idea what's happening or what I'm getting wrong?
     
  2. Pema-Malling

    Pema-Malling

    Unity Technologies

    Joined:
    Jul 3, 2020
    Posts:
    320
    Maybe you want something like Linear falloff type?

    https://docs.unity3d.com/2023.1/Documentation/Manual/ProgressiveLightmapper-CustomFallOff.html
    This docs page contains a script that will let you control the falloff used by the lightmappers for various kinds of light.
     
  3. sdadamd59

    sdadamd59

    Joined:
    Nov 5, 2018
    Posts:
    4
    Thank you for the reply! That definitely is helpful to know about, and I might experiment with that. But I'm not sure it solves the problem, as the issue is that right now changing the range seems to have no effect on the range of the light when its baked. No matter the falloff type, the range should have an impact, right?

    For example, here in the same scene, when I make a copy of one of the lights, it looks like this (the original light which is baked in the lightmap is on the right, and the duplicate is on the left,) until I bake it. Once its baked, the light on the left is now subdued and dim like the other lights.



    Another weird thing, if I change one of the lights to realtime, it doesn't act real time in the editor until I clear my GI cache. That is, the light doesn't change when I move it or adjust the settings.
     
    Last edited: Sep 7, 2022
  4. kristijonas_unity

    kristijonas_unity

    Unity Technologies

    Joined:
    Feb 8, 2018
    Posts:
    1,080
    Which render pipeline are you on? URP and HDRP both use inverse square falloff which is physically based. Meaning that increasing the range of the light will have no impact on its intensity.
     
  5. sdadamd59

    sdadamd59

    Joined:
    Nov 5, 2018
    Posts:
    4
    URP. I guess I just didn't realize that changing the range would have no effect on the baked lighting. It definitely changes the area affected by the light in real time, just not when baked. It seems like there is a huge different in how far the light reaches when its real time compared to baked.
     
  6. kristijonas_unity

    kristijonas_unity

    Unity Technologies

    Joined:
    Feb 8, 2018
    Posts:
    1,080
    Realtime and baked intensities should match in URP and HDRP. Please make sure that you are in Linear color space.
     
  7. sdadamd59

    sdadamd59

    Joined:
    Nov 5, 2018
    Posts:
    4
    I just checked, I am in linear color space.
     
  8. kristijonas_unity

    kristijonas_unity

    Unity Technologies

    Joined:
    Feb 8, 2018
    Posts:
    1,080
    In that case, please report a bug, and for the URP team to evaluate.