本页介绍如何设置场景以进行遮挡剔除、烘焙遮挡剔除数据以及对结果进行可视化。
在开始之前,请确定场景中所有要设定为静态遮挡物 (Static Occluder)(这些游戏对象不会移动,但会阻挡后面的游戏对象)和静态被遮挡物 (Static Occludee)(这些游戏对象不会移动,但会被静态遮挡物遮挡)。一个游戏对象可以同时是静态遮挡物和静态被遮挡物。
适合作为静态遮挡物的游戏对象包括中型到大型的实体游戏对象(例如墙壁或建筑物)。要被设定为静态遮挡物,游戏对象必须满足以下条件:
请注意,如果使用了 LOD 组,则 Unity 会使用静态遮挡物的基础细节级别游戏对象 (LOD0) 来确定要遮挡的对象。如果游戏对象的轮廓在 LOD0 和其他 LOD 级别之间变化很大,这个游戏对象可能不适合设定为静态遮挡物。
任何可能在运行时被遮挡的游戏对象都适合设定为静态被遮挡物,包括小的或透明的游戏对象。要被设定为静态被遮挡物,游戏对象必须满足以下条件:
确定了要设定为静态遮挡物和静态被遮挡物的游戏对象之后,便可以设置场景。
如果使用的是内置渲染管线,则可以使用 Scene 视图模式 Overdraw_ 来查看正在发生的过度绘制数量,并可以使用 Game 视图中的 Stats 面板来查看 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.