Unity Build Automation does not support building light maps, causing darker 3D assets compared to local builds. This issue occurs if Precomputed Realtime GI with Auto Build is enabled or build results aren't committed. To fix, disable Auto-Generate Lighting per scene, manually build and commit lightmap files like LightingData.asset and Lightmap-xxx.exr. More details are available in Unity's lightmapping documentation.
Symptoms
- My build, when using Unity Build Automation, is much darker than a local build.
- 3D assets are dark when using Unity Build Automation to build the game.
Cause
Unity Build Automation does not currently support building lightmapping, and attempting to do so may result in the above-mentioned issue and poor build performance. There are a couple of possible causes that might explain what is going wrong:
- You are using Precomputed Realtime GI for your scene and the Auto Build for lightmaps is enabled.
- Your build results are not checked into your repository.
Resolution
For older versions of the Editor, ensure that you have turned off Auto-Generate Lighting in your scenes (it is a per-scene setting), and manually build (and commit) your light maps. Depending on what your scene includes and your lighting settings, you will need to commit the following files:
- LightingData.asset
- LightmapSnapshot.asset
- Lightmap-xxx.exr
- Lightprobe-xxx.exr
The files are stored in a subfolder named after the scene in the same folder as your scene. For more information about lightmaps, please read here.
More Information
For more information about lighting, please read here.