Search Unity

LOD's Lightmap Projection - Baking problem

Discussion in 'Global Illumination' started by eduroam, Jan 24, 2020.

  1. eduroam

    eduroam

    Joined:
    Jul 2, 2015
    Posts:
    48
    Hi guys.

    As we know Unity has some problems with objects with LOD's, where the bake time increases a lot.

    Unity provides a script in the FPS Sample project.

    I used that scripts into my project and yes the time baking now is good but I have a problem that I will explain with video support.

    http://eduardoroacg.com/downloads/forum/unity/LODProjectionIssue_1.mp4

    You are watching a scene with bake light + Lightmap Projection in the LOD's.

    In the first seconds, you can see that the projection works very well in the Editor and in play mode.

    The problem comes when I build the project and play the build version, as you can see in the video the meshes have some visual flick when they change to LOD0 to LOD1, the LOD1 is not taken the bake light information from LOD0.

    Why?

    I realized that if I do not place the "ProjectLODLightmapManager" file in the GO where are the Volumen settings (like FPS Sample project), the same problem happens in the Editor.

    So that means that I missing something when I build? Is it not load the script?, but I saw the script and look that the code is for the editor, so what happen in the building?.


    Thanks
    Eduardo
     
  2. kristijonas_unity

    kristijonas_unity

    Unity Technologies

    Joined:
    Feb 8, 2018
    Posts:
    1,080
    Lightmap projection scripts should be still considered as "work in progress" and are not guaranteed to work in all production scenarios. We are working on it.

    In the meanwhile, you could instead try setting up a light probe network in your level, and mark your lower LOD objects as dynamic. That will make said objects sample light probes for GI.

    Alternatively, you could try using lightmap thief script and see if that works for you. More info here - https://github.com/laurenth-unity/LODLightmapScripts