StaticBatchingUtility静态批处理工具

StaticBatchingUtility 静态批处理工具

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

StaticBatchingUtility可以准备你的物体,利用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.

这步是非常有用的,作为性能优化允许引擎去减少大幅的draw-calls(描绘指令)数,但保持完整的渲染几何量。

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 effecient culling and results in much higher amount of geometry being rendered.

通过调用Combine方法,将创建一个内部网格,其中包含合并的几何体,然而每个原始游戏物体,将出现在场景,并且被单独检选。事实上,GameObjects可以单独检选,允许运行时渲染同样数量几何体,因此没有批处理,不像在建模工具合并几何体。在建模工具合并几何体,防止生效的剔除和导致较高的几何体数量被渲染。

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.

注意,你不需要在物体上调用Combine方法,本来就在编辑器已经标识为“Static”。它们将准备在生成时,自动静态批处理。

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

主要事项:仅在物体具有相同材质可以被批处理,因此你可以用于共享尽可能多的纹理/材质。

Class Functions类函数

  • Combine
    Combine will prepare all children of the staticBatchRoot for static batching.
    合并将准备staticBatchRoot的所有子物体用于静态批处理。
### 部署 Stable Diffusion 的准备工作 为了成功部署 Stable Diffusion,在本地环境中需完成几个关键准备事项。确保安装了 Python 和 Git 工具,因为这些对于获取源码和管理依赖项至关重要。 #### 安装必要的软件包和支持库 建议创建一个新的虚拟环境来隔离项目的依赖关系。这可以通过 Anaconda 或者 venv 实现: ```bash conda create -n sd python=3.9 conda activate sd ``` 或者使用 `venv`: ```bash python -m venv sd-env source sd-env/bin/activate # Unix or macOS sd-env\Scripts\activate # Windows ``` ### 下载预训练模型 Stable Diffusion 要求有预先训练好的模型权重文件以便能够正常工作。可以从官方资源或者其他可信赖的地方获得这些权重文件[^2]。 ### 获取并配置项目代码 接着要做的就是把最新的 Stable Diffusion WebUI 版本拉取下来。在命令行工具里执行如下指令可以实现这一点;这里假设目标路径为桌面下的特定位置[^3]: ```bash git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git ~/Desktop/stable-diffusion-webui cd ~/Desktop/stable-diffusion-webui ``` ### 设置 GPU 支持 (如果适用) 当打算利用 NVIDIA 显卡加速推理速度时,则需要确认 PyTorch 及 CUDA 是否已经正确设置好。下面这段简单的测试脚本可以帮助验证这一情况[^4]: ```python import torch print(f"Torch version: {torch.__version__}") if torch.cuda.is_available(): print("CUDA is available!") else: print("No CUDA detected.") ``` 一旦上述步骤都顺利完成之后,就可以按照具体文档中的指导进一步操作,比如调整参数、启动服务端口等等。整个过程中遇到任何疑问都可以查阅相关资料或社区支持寻求帮助。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值