在 Unity 中,预计算光照在后台作为自动过程生成或在用户手动启动时生成。在这些过程运行的同时,仍可以在 Editor 中继续工作。
When the precompute process is running, a blue progress bar will appear in the bottom right of the Editor. There are different stages which need to be completed depending on whether Baked GI or Realtime GI is enabled. Information on the current process is shown on top of the progress bar.
光照预计算的阶段如下:
Realtime GI
探针 (Probes)
烘焙 GI (Baked GI)
Unity 的预计算光照解决方案仅考虑静态几何体。要开始光照预计算过程,需要在场景中至少将一个游戏对象标记为“静态”。
手动启动预计算时,系统将评估和计算场景光照的所有方面。要自行重新计算并仅烘焙反射探针,请在 Lighting 窗口中单击 Generate Lighting 按钮附带的下拉菜单。
注意:使用 Auto Generate 模式时,Unity 会将您的光照数据存储在有限大小的临时缓存中。这意味着,当超出缓存的大小时,Unity 会删除旧的光照数据。如果某些场景依赖于已删除的自动生成的光照数据,则在构建项目时可能会出现问题。在这种情况下,您的场景可能在构建的项目中没有正确的光照。因此,在构建游戏之前,应取消选中 __Auto Generate__,并手动为所有场景生成光照数据。Unity 随后会将您的光照数据作为资源文件保存在项目文件夹中,这意味着数据将保存为项目的一部分并包含在您的构建版本中。
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.