预先计算实时 GI 时以及烘焙静态光照贴图、光照探针和反射探针时,全局光照 (GI) 系统使用 GI 缓存来存储中间文件。该缓存将在计算机上的所有 Unity 项目之间共享,因此具有相同内容和相同版本的光照系统 (Enlighten) 的项目可以共享文件并加速后续构建。
可以使用 GI Cache 偏好设置来管理缓存的大小、位置和压缩。有关更多信息,请参阅偏好设置 (Preferences) 文档。
要在重新加载场景时确保在很短的时间内从 GI 缓存加载光照数据,请打开 Lighting 窗口(菜单:__Window__ > Lighting__),然后用 Build 按钮旁边的 Auto__ 选项。此设置将使光照贴图自动进行烘焙,这意味着光照贴图数据会存储在 GI 缓存中。
在 Lighting 窗口中,可清除场景中的烘焙数据(禁用 Auto 选项,并从 Build 按钮下拉菜单中选择 __Clear Baked Data__)。此操作不会清除 GI 缓存,因为这样做会增加烘焙时间。
您可以在不同的计算机之间共享 GiCache 文件夹。这种做法可以使光照构建速度更快,因为文件是从 GiCache 文件夹进行下载的,无需在本地进行计算。请注意,构建过程未针对慢速的网络连接存储 (NAS) 进行优化,因此请在将缓存移至 NAS 之前测试烘焙时间是否受到严重影响。
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.