Lightmap and Shadow Baking Tutorial

Lightmap Settings


Using lightmaps to bake your shadows can give reasonably good looking tree shadows, with no frame rate cost. Included in the folder located at Assets\LushLOD Trees\Lightmap Settings are screenshots showing the scene setup that was used for the Gaia Demo scene.


I will be creating a video tutorial soon to demonstrate the correct lightmap settings.


Below is a brief explanation of each setting:


  1. Select _LushLODTreesManager gameobject (it should be in your hierarchy):
    Scroll down and click the "Ready Shadow Baking" button to enter shadow baking mode.
  2. Go to Window->Lighting->Scene:



    For the Gaia Demo, I used the settings seen in the above image.
  3. Go to Window->Lighting->Object->with terrain selected:


    With the Light window open, and the Object tab open, select your terrain(s) in your hierarchy. For the Gaia Demo, I used the settings seen in the above image.

    Then, set your Terrain Parameters to the following:
    (Note that you can simply use LushLOD_TerrainLightmapSettings)



    LushLOD_TerrainLightmapSettings.giparams is saved in the Lightmap Settings folder.
    Be sure that the pushoff value is not less than 0.001, otherwise there can be errors in the bake.
  4. Go to Window->Lighting->Object->with all gameobjects named "Lod_1" selected:
    Lod_1 is the name of the billboard gameobjects. Search the hierarchy for "Lod_1" and select them all.



    For the Gaia Demo, I used the settings seen in the above image. Note that the Scale in Lightmap is set to zero.

    Then, set your billboard's parameters to the following:
    (Note that you can simply use LushLOD_TreeLightmapSettings)


    LushLOD_TreeLightmapSettings.giparams is in the Lightmap Settings folder.
    Note that only the billboards should be enabled during baking. The high quality tree models do not support it.

    Be sure that the pushoff value is not less than 0.001, otherwise there can be errors in the bake.
  5. Select your main directional light:

    I used the settings in the image below for my main directional light.
    My intensity was set to 0.8, and my Bounce Intensity was 1.

Once you've looked over the above settings, your scene should be ready to be baked. Note that this setup was designed solely to bake the shadows of the billboard trees. If you wish to also bake other objects in your scene, you will need to modify this setup as

necessary to make that happen.


Once you are ready, go to Window->Light->Scene and click the "Bake" button. The process may take several hours for a large scene.


When the baking process is finished, Unity will have created a folder with the same name as your scene (aka "Gaia Demo"), and in that folder you will find a file or files with a name similar to Lightmap...light.exr. The largest copies of this file is probably the terrain. You will most likely want to open these files in Photoshop, and edit them a little to reduce the intensity of the shadows (if they appear almost totally black).


Using Photoshop to improve contrast:


Again, I will be creating a video tutorial soon for all this. :)

Is this article helpful for you?