Unity Build Automation lightmap baking

Symptoms

  • Builds you create with Unity Build Automation are much darker than a local build.
  • 3D assets are dark when you use Unity Build Automation to build the game.

Causes

Unity Build Automation doesn't support building lightmaps, and if you try to build a lightmap the builds might be too dark and have poor build performance. There are two possible causes:

  • You use Precomputed Realtime GI for your scene and have the Auto Build for lightmaps enabled.
  • You haven't checked in your build maps into your repository.

Resolution

Turn off Auto Build in your scenes and manually build and commit your lightmaps. Depending on what your scene includes and your lighting settings, you need to commit the following files:

  • LightingData.asset
  • LightmapSnapshot.asset
  • Lightmap-xxx.exr
  • Lightprobe-xxx.exr

The files are in a subfolder named after the scene in the same folder as your scene. For more information about lightmaps please refer to this documentation on how to set up your scene and lights for baking.