返回介绍

StaticBatchingUtility 静态批处理工具

发布于 2019-12-18 15:38:34 字数 1995 浏览 1126 评论 0 收藏 0

class in UnityEngine

Description 描述

StaticBatchingUtility can prepare your objects to take advantage of Unity's static batching.

静态批处理工具可以适用于你的对象具有Unity的静态批处理的优点。

This step is useful as a performance optimization allowing engine to reduce number of draw-calls dramatically, but keep amount of rendered geometry intact.

该步骤主要用于性能优化,允许引擎减少绘制调用的数量,但是保持渲染的完整几何体的数量。

By calling one of the Combine methods you will create an internal mesh which will contain combined geometry, however each original GameObject will be present in the scene and will be culled individually. The fact that GameObjects can be culled individually allows run-time to render the same amount of geometry as it would without batching, unlike combining geometry in the modeling tool. Combining geometry in the modeling tool prevents efficient culling and results in much higher amount of geometry being rendered.

通过调用其中一个相结合的方法,您将创建一个内部的网格,其中将包含合并的几何体,然而每个原始的游戏物体将出现在现场,并且将单独剔除。事实上游戏对象可以单独剔除出来,允许运行时呈现相同数量的几何形状,因此没有批处理,不像在建模工具中合并几何体。在建模工具中组合几何体阻碍有效剔除和导致更多数量的几何体被渲染。

Note that you do not need to call Combine methods on objects which were already marked as “Static” in the Editor. They will be prepared for static batching automatically during the Build Player step.

注意在编辑器中对象已经标记为静态后你不需要去调用组合方法。它们会在建立Player步骤期间自动准备为静态批处理。

IMPORTANT: only objects with the same material can be batched, thus it is useful to share as many textures/material as you can.

注意:仅材质相同的对象可以批处理,因此用于该处理和你使用的贴图/材质同样多。

Static Functions 静态函数

CombineCombine will prepare all children of the staticBatchRoot for static batching.
合并属性将准备为所有静态根的子集进行静态批处理。

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文