要在延迟渲染路径中使用着色器,请将 UniversalGBuffer 标签添加到__ ShaderLab__Unity 用于定义着色器对象结构的语言。更多信息
See in Glossary 代码中的通道。Unity 会在 G 缓冲区渲染通道期间执行该着色器。
例如:
Shader "Examples/ExamplePassFlag"
{
SubShader
{
Pass
{
Tags
{
"RenderPipeline" = "UniversalPipeline"
"LightMode" = "UniversalGBuffer"
}
// The rest of the code that defines the Pass goes here.
}
}
}
要在延迟渲染路径中使用着色器,请将 UniversalForwardOnly 和 DepthNormalsOnly 标签添加到 ShaderLab 代码中的通道。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.
}
}
}