Version: Unity 6.1 Alpha (6000.1)
Language : English
Branch in a shader via built-in macros
Branch based on shader model

Branch based on platform or graphics API

Macro: Target platform:
SHADER_API_D3D11 Direct3D 11
SHADER_API_GLCORE Desktop OpenGL “core” (GL 3/4)
SHADER_API_GLES3 OpenGL ES 3.0/3.1
SHADER_API_METAL iOS/Mac Metal
SHADER_API_VULKAN Vulkan
SHADER_API_D3D11_9X Direct3D 11 “feature level 9.x” target for Universal Windows Platform
SHADER_API_DESKTOP Windows, Mac and Linux desktop platforms, Web
SHADER_API_MOBILE iOS and Android mobile platforms, tvOS

Additionally, SHADER_TARGET_GLSL is defined when the target shading language is GLSL (always true for OpenGL/GLES platforms).

Additional resources


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