Make a shader compatible with the Deferred or Deferred+ rendering paths in URP
Use the LightMode tag in a shader to make the shader compatible with the Deferred rendering path.
읽는 시간 1분최근 업데이트: 한 달 전
Use a shader in the Deferred or Deferred+ rendering paths
To use a shader in the Deferred rendering path, add the tag to the Pass in your ShaderLab code. Unity executes the shader during the G-buffer render pass.
UniversalGBufferFor example:
Shader "Examples/ExamplePassFlag"{ SubShader { Pass { Tags { "RenderPipeline" = "UniversalPipeline" "LightMode" = "UniversalGBuffer" } // The rest of the code that defines the Pass goes here. } }}
Use a shader in the forward pass of the Deferred or Deferred+ rendering paths
To use a shader in the Deferred rendering path, add the and tags to the Pass in your ShaderLab code. Unity executes the shader during the G-buffer render pass.
UniversalForwardOnlyDepthNormalsOnlyFor example:
Shader "Examples/ExamplePassFlag"{ SubShader { Pass { Tags { "RenderPipeline" = "UniversalPipeline" "LightMode" = "UniversalForwardOnly" "LightMode" = "DepthNormalsOnly" } // The rest of the code that defines the Pass goes here. } }}
Specify the shader lighting model
To specify the shader lighting model as Lit or Simple Lit, use the tag. For example:
UniversalMaterialTypeShader "Examples/ExamplePassFlag"{ SubShader { Pass { Tags { "RenderPipeline" = "UniversalPipeline" "LightMode" = "UniversalGBuffer" "UniversalMaterialType" = "Lit" } // The rest of the code that defines the Pass goes here. } }}