ディファードレンダリングパスでシェーダーを使用するには、ShaderLab コードでパスに UniversalGBuffer タグを追加します。Unity は G バッファレンダーパス中にシェーダーを実行します。
以下に例を示します。
Shader "Examples/ExamplePassFlag"
{
SubShader
{
Pass
{
Tags
{
"RenderPipeline" = "UniversalPipeline"
"LightMode" = "UniversalGBuffer"
}
// The rest of the code that defines the Pass goes here.
}
}
}
ディファードレンダリングパスでシェーダーを使用するには、ShaderLab コードで UniversalForwardOnly タグと DepthNormalsOnly タグをパスに追加します。Unity は G バッファレンダーパス中にシェーダーを実行します。
以下に例を示します。
Shader "Examples/ExamplePassFlag"
{
SubShader
{
Pass
{
Tags {
"RenderPipeline" = "UniversalPipeline"
"LightMode" = "UniversalForwardOnly"
"LightMode" = "DepthNormalsOnly"
}
// The rest of the code that defines the Pass goes here.
}
}
}
シェーダーライティングモデルを Lit または Simple Lit に指定するには、UniversalMaterialType タグを使用します。以下に例を示します。
Shader "Examples/ExamplePassFlag"
{
SubShader
{
Pass
{
Tags
{
"RenderPipeline" = "UniversalPipeline"
"LightMode" = "UniversalGBuffer"
"UniversalMaterialType" = "Lit"
}
// The rest of the code that defines the Pass goes here.
}
}
}