ドキュメント

Unity Engine


User Manual

Script Reference

Unity Engine


Branch in a shader via built-in macros

Resources for adding shader branches with built-in macros based on platform, graphics API, shader model, Unity version, shader pass, or shader stage.
読み終わるまでの所要時間 1 分最終更新 1ヶ月前

Resources for adding a condition in a shader based on the platform, shader model, Unity Version, or shader pass.

Page

Description

Branch based on platform or graphics APIUse
SHADER_API
macros to make shader behaviour conditional on the platform or graphics API.
Branch based on shader modelUse
SHADER_TARGET
to make shader behaviour conditional on the shader model.
Branch based on platform featuresUse platform difference helpers to make shader behaviour conditional on platform functionality.
Branch based on Unity versionUse
UNITY_VERSION
to make shader behaviour conditional on the Unity version.
Branch based on shader pass or shader stageUse
SHADER_STAGE
or
UNITY_PASS
to make shader behaviour conditional on the shader stage or shader pass.

Additional resources