Game 视图包括一个统计窗口,显示您的应用程序在运行模式下的实时渲染信息。要打开此窗口,请单击右上角的 Stats 按钮。该窗口会在 Game 视图右上角叠加显示。它包含的统计信息对于优化性能很有用。显示的具体统计信息根据构建目标而有所不同。
Statistics 窗口的 Graphics 部分包含以下信息:
统计信息 | 描述 |
---|---|
FPS | Unity 每秒执行的帧更新。 |
CPU |
Main: 处理一帧所花费的总时间。该数字包括 Unity 处理应用程序帧更新所用的时间,以及 Unity 在编辑器中更新 Scene 视图、其他编辑器窗口或处理仅编辑器任务所用的时间。 Render:渲染一帧所花费的时间。该数字包括 Unity 渲染 Game 视图所花费的时间;它不包括 Unity 在编辑器中渲染 Scene 视图或绘制 Inspector 所花费的时间。 |
Batches | Unity 在一帧内处理的批次总数。该数字包括静态和动态批次。 |
Saved by batching | Unity 合并的批次数。为确保良好的批处理,应尽可能在不同游戏对象之间共享材质。更改渲染状态会将批次分成具有相同状态的组。 |
Tris | Unity 在一帧内处理的三角形数。在针对低端硬件进行优化时,这一点非常重要。 |
Verts | Unity 在一帧内处理的顶点数。在针对低端硬件进行优化时,这一点非常重要。 |
Screen | 屏幕的分辨率及其使用的内存量。 |
SetPass | Unity 在一帧中切换用于渲染游戏对象的着色器通道的次数。一个着色器可能包含多个着色器通道,每个通道以不同的方式渲染场景中的游戏对象。每个 pass 都需要 Unity 绑定一个新的着色器,这可能会带来 CPU 开销。 |
Shadow casters | 在一帧中投射阴影的游戏对象的数量。 |
Visible skinned meshes | Unity 在帧中渲染的带蒙皮的网格渲染器的数量。 |
Animations | 帧期间播放的动画数量。 |
如果您想了解有关应用程序渲染性能的更多详细信息,请参阅 Profiler 窗口的 Rendering 模块。
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.