# Unity Build Automation 光照贴图烘焙

> Resolve Unity Build Automation lightmap baking issues and understand common causes and solutions.

## 症状##symptoms

* 使用 Unity Build Automation 创建的构建比本地构建明显更暗。
* 使用 Unity Build Automation 构建游戏时，3D 资源显得很暗。

## 原因##causes

Unity Build Automation 不支持构建光照贴图，如果尝试构建光照贴图，构建出的版本可能会太暗，且构建性能不佳。可能原因有两种：

* 您为场景使用了 Precomputed Realtime GI，并且启用了光照贴图的**自动构建**。
* 您尚未将构建好的贴图签入代码仓库。

## 解决方案##resolution

在场景中关闭 **Auto Build（自动构建）**，然后手动构建并提交光照贴图。根据场景内容和光照设置，您需要提交以下文件：

* `LightingData.asset`
* `LightmapSnapshot.asset`
* `Lightmap-xxx.exr`
* `Lightprobe-xxx.exr`

这些文件位于场景所在同一文件夹下以场景命名的子文件夹中。有关光照贴图的更多信息，请参阅这篇关于如何[设置场景和光源进行烘焙](https://docs.unity3d.com/Manual/Lightmapping.html)的文档。
