预先计算实时全局光照(已启用)、光照贴图、光照探针和反射探针的光照数据时,Unity Editor 使用 GI 缓存作为内部数据缓存来存储中间文件。通过将此数据存储在缓存中,Unity 可以加快后续的预计算。
该缓存将在计算机上的所有 Unity 项目之间共享,因此具有相同内容和光照贴图后端的项目可以共享文件。
可以使用 GI Cache 偏好设置来管理缓存的大小、位置和压缩。有关更多信息,请参阅偏好设置 (Preferences) 文档。
当自动预先计算光照数据时,Unity Editor 将使用 GI 缓存。要启用 GI 缓存,请打开 Lighting 窗口(菜单:__Window__ > Lighting Settings__),然后启用 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.