Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Weird Real-time Lighting Results On Static Objects With Lod

Discussion in 'Global Illumination' started by dgoyette, Apr 11, 2019.

  1. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,215
    I've recently added LOD to a few of my objects, some of which are static objects. I'm finding that realtime lighting is behaving strangely on those objects now, and I don't know if I've done something wrong, or if this is a shortcoming of the realtime lighting system.

    It seems like only one of the meshes in my LODGroup actually get lightmapped. When the scene loads, I can see lighting on the object, but if I move closer to it, such that the mesh is replaced with one of the other LOD meshes, all of the lighting on the object disappears.

    I saw a post from back in 2015 stating that this was how things worked then, but there was hope that it would be improved. Does anyone know if this was actually improved? Or is realtime GI lighting on static objects not compatible with LOD?

    Thanks.
     
  2. kristijonas_unity

    kristijonas_unity

    Unity Technologies

    Joined:
    Feb 8, 2018
    Posts:
    1,080
    If you have only realtime GI enabled, then only the top level LOD will get lightmapped. The rest will receive lighting from light probes. You can read more about it here - https://docs.unity3d.com/Manual/LODRealtimeGI.html

    It is strange, however, that the lighting disappears when you approach the object. Make sure that your LODs are properly setup (with LOD0 being the highest detail mesh) both in your .FBX files in the prefab.
     
  3. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,215
    Ah, thanks. I'll look into that. I'll do some experimentation with it. My earlier statement might have been wrong without realizing it. It might be more of an issue with emission generation from the static LOD meshes. But I appreciate the link.
     
  4. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,215
    As I suspected, it seems this is an issue with emissive lighting. Objects lit by light probes get a very different amount of lighting on them compared to static objects. For example, here's a door at LOD0. The outer frame of the door is the mesh I'm using LOD on:

    upload_2019-4-11_15-40-10.png

    If I step back a little to reach LOD1, it looks like this instead:

    upload_2019-4-11_15-41-11.png

    The red lighting the frame's picking up is the emissive light coming from the lights on the door.

    The hard jump in lighting when changing an LOD level is not very attractive at all, and it's very noticeable. Do you know of any techniques to improve this behavior? I tried turning off Blend Probes on the LOD1/2 meshes, but then they just look like this instead:

    upload_2019-4-11_15-45-54.png
     
  5. kristijonas_unity

    kristijonas_unity

    Unity Technologies

    Joined:
    Feb 8, 2018
    Posts:
    1,080
    Thanks for the screenshots. The lower LODs are most likely interpolating between neutral ambient light and emissive light, and the result you are seeing is something in-between. You could try increasing the probe density around the door, but that will not help all by itself. You will most likely need to rely on LPPVs in order to get more correct probe sampling for your door. You can read more about LPPVs here - https://docs.unity3d.com/Manual/class-LightProbeProxyVolume.html
     
    dgoyette likes this.