Version: Unity 6.2 Alpha (6000.2)
Language : English
Static and dynamic branching in a shader
Branch based on platform or graphics API

Branch in a shader via built-in macros

Resources for adding a condition in a shaderA program that runs on the GPU. More info
See in Glossary
based on the platform, shader model, Unity Version, or shader pass.

Page Description
Branch based on platform or graphics API Use SHADER_API macros to make shader behaviour conditional on the platform or graphics API.
Branch based on shader model Use SHADER_TARGET to make shader behaviour conditional on the shader model.
Branch based on platform features Use platform difference helpers to make shader behaviour conditional on platform functionality.
Branch based on Unity version Use UNITY_VERSION to make shader behaviour conditional on the Unity version.
Branch based on shader pass or shader stage Use SHADER_STAGE or UNITY_PASS to make shader behaviour conditional on the shader stage or shader pass.

Additional resources


对文档有任何疑问,请移步至开发者社区提问,我们将尽快为您解答
Static and dynamic branching in a shader
Branch based on platform or graphics API
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961