Version: Unity 6.1 Alpha (6000.1)
Language : English
Prioritize lower quality shaders with the LOD command
Get tag values in a script

Disable dynamic batching of a shader

The DisableBatching SubShader Tag prevents Unity from applying Dynamic BatchingAn automatic Unity process which attempts to render multiple meshes as if they were a single mesh for optimized graphics performance. The technique transforms all of the GameObject vertices on the CPU and groups many similar vertices together. More info
See in Glossary
to geometry that uses this SubShader.

This is useful for shaderA program that runs on the GPU. More info
See in Glossary
programs that perform object space operations. Dynamic Batching transforms all geometry into world space, meaning that shader programs can no longer access object space. Shader programs that rely on object space therefore do not render correctly. To avoid this problem, use this SubShader Tag to prevent Unity from applying Dynamic Batching.

Examples

This example code creates a SubShader with a DisableBatching value of True:

Shader "ExampleShader" {

    SubShader {

        Tags { "DisableBatching" = "True" }
        Pass {
            …
        }

    }

}

对文档有任何疑问,请移步至开发者社区提问,我们将尽快为您解答
Prioritize lower quality shaders with the LOD command
Get tag values in a script
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961