To use a shaderA program that runs on the GPU. More info
See in Glossary in the Deferred rendering pathThe technique that a render pipeline uses to render graphics. Choosing a different rendering path affects how lighting and shading are calculated. Some rendering paths are more suited to different platforms and hardware than others. More info
See in Glossary, add the UniversalGBuffer
tag to the Pass in your ShaderLabUnity’s language for defining the structure of Shader objects. More info
See in Glossary code. Unity executes the shader during the G-buffer render pass.
For example:
Shader "Examples/ExamplePassFlag"
{
SubShader
{
Pass
{
Tags
{
"RenderPipeline" = "UniversalPipeline"
"LightMode" = "UniversalGBuffer"
}
// The rest of the code that defines the Pass goes here.
}
}
}
To use a shader in the Deferred rendering path, add the UniversalForwardOnly
and DepthNormalsOnly
tags to the Pass in your ShaderLab code. Unity executes the shader during the G-buffer render pass.
For example:
Shader "Examples/ExamplePassFlag"
{
SubShader
{
Pass
{
Tags {
"RenderPipeline" = "UniversalPipeline"
"LightMode" = "UniversalForwardOnly"
"LightMode" = "DepthNormalsOnly"
}
// The rest of the code that defines the Pass goes here.
}
}
}
To specify the shader lighting model as Lit or Simple Lit, use the UniversalMaterialType
tag. For example:
Shader "Examples/ExamplePassFlag"
{
SubShader
{
Pass
{
Tags
{
"RenderPipeline" = "UniversalPipeline"
"LightMode" = "UniversalGBuffer"
"UniversalMaterialType" = "Lit"
}
// The rest of the code that defines the Pass goes here.
}
}
}