Version: 2017.2

Material.SetShaderPassEnabled

切换到手册
public void SetShaderPassEnabled (string passName, bool enabled);

参数

passName 着色器通道名称(不区分大小写)。
enabled 标志,用于指示是否应启用此着色器通道。

描述

在每个材质级别上启用或禁用着色器通道。

By default, all Shader passes are enabled. This function allows a Material to treat a specific Shader pass (as indicated by LightMode pass tag) as if it does not exist in the Shader. For example, if the Shader has a "refraction" pass but you only want to enable it on Materials that have a refraction Texture assigned, pass "refraction" as passName and false for enabled for Materials without a refraction Texture assigned. Note that the Shader pass enable/disable flag only affects custom rendering pipelines that use the RenderLoop class (via RenderLoop.DrawRenderers or RenderLoop.DrawShadows).

另请参阅:GetShaderPassEnabled、RenderLoop、Shader pass tags

Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961