Version: Unity 6.0 (6000.0)
言語 : 日本語
HLSL シェーダープログラムの追加
シェーダーへの頂点データの入力

複数のプログラムでの HLSL の複製

HLSL コードを他の HLSLPROGRAM セクションに加えるには、HLSLINCLUDE ディレクティブを使用します。

Shader "Examples/ExampleShader"
{
    SubShader
    {

        HLSLINCLUDE
            // HLSL code that you want to share goes here
        ENDHLSL

        Pass
        {                
              Name "ExampleFirstPassName"
              Tags { "LightMode" = "ExampleLightModeTagValue" }

              // ShaderLab commands to set the render state go here

              HLSLPROGRAM
                // This HLSL shader program automatically includes the contents of the HLSLINCLUDE block above
                // HLSL shader code goes here
              ENDHLSL
        }

        Pass
        {                
              Name "ExampleSecondPassName"
              Tags { "LightMode" = "ExampleLightModeTagValue" }

              // ShaderLab commands to set the render state go here

              HLSLPROGRAM
                // This HLSL shader program automatically includes the contents of the HLSLINCLUDE block above
                // HLSL shader code goes here
              ENDHLSL
        }

    }
}

追加リソース

HLSL シェーダープログラムの追加
シェーダーへの頂点データの入力