光照数据资源可以存储 Unity Editor 场景预计算的光照数据。出于工作流程原因,光照数据资源在项目中作为单独的文件存在;将预计算的光照数据存储在单独的文件中意味着对预计算的光照数据的更改不会导致对场景文件的更改。光照数据资源不供用户编辑。
使用 Lighting 窗口中的 Generate Lighting 按钮或使用 Lightmapping.Bake 或 Lightmapping.BakeAsync API 来手动调用光照预计算时,Unity 会将预计算的光照数据存储在光照数据资源中。
The Lighting Data Asset contains global illumination data and all the supporting files needed to recreate the lighting for a scene. This asset references the renderers, the real-time lightmaps, the baked lightmaps, light probes, reflection probes and a data structure which stores the relationships between these elements. It also includes all the precomputed Enlighten Realtime Global Illumination data needed to update how real-time global illumination looks in the Player.
当您更改场景时(例如,中断一个标记为 Contribute GI 的游戏对象上的预制件连接),资源数据将过时,因此必须重新构建。
在光照构建过程中生成但生成播放器构建时不需要的中间文件不属于资源的一部分,因此存储在 GI 缓存中。
光照数据资源的构建时间可能有所不同。如果您的 GI 缓存已填满,例如,您之前在机器上进行了烘焙(场景处于最新状态),则构建速度会很快。如果将场景拉到空缓存的计算机或由于缓存大小限制而删除了所需的缓存数据,则必须首先使用中间文件填充缓存,而这需要运行预计算和烘焙过程。这些步骤可能会消耗一些时间。
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.