Table of Contents

Class PostProcessRendererFeature<TShaderProperties>

Namespace
Gamelogic.Fx.URP.PostProcessing
Assembly
Gamelogic.Fx.URP.dll

Implements a simple URP post-processing effect using a single shader and a single render pass.

public class PostProcessRendererFeature<TShaderProperties> : PostProcessRendererFeature, IDisposable where TShaderProperties : ShaderProperties, new()

Type Parameters

TShaderProperties

The type that defines and applies the shader properties for this effect.

Inheritance
ScriptableRendererFeature
PostProcessRendererFeature<TShaderProperties>
Implements
Derived
Inherited Members
ScriptableRendererFeature.isActive
ScriptableRendererFeature.OnCameraPreCull(ScriptableRenderer, in CameraData)
ScriptableRendererFeature.Dispose()
Object.Instantiate(Object, Vector3, Quaternion)
Object.Instantiate(Object)
Object.Instantiate(Object, Transform)
Object.Instantiate<T>(T)
Object.Instantiate<T>(T, Vector3, Quaternion)
Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
Object.Instantiate<T>(T, Transform)
Object.Destroy(Object)
Object.DestroyImmediate(Object)
Object.DestroyObject(Object)
Object.FindObjectsOfType<T>()
Object.name
Object.hideFlags

Remarks

This class is the URP counterpart to the built-in PostProcess<TShaderProperties> component.

It manages shader lookup, material creation, and render-pass injection, delegating all shader configuration to the associated ShaderProperties instance.

On Unity 6 and newer with render graph enabled, the pass uses RecordRenderGraph and UnityEngine.Rendering.RenderGraphModule.Util.RenderGraphUtils.AddBlitPass. On older versions or when compatibility mode is active, the pass uses the legacy Execute path with CommandBuffer.Blit.

To define a new URP post-process effect:
  1. Create a subclass of ShaderProperties that defines the shader name and parameters.
  2. Create a concrete renderer feature inheriting from PostProcessRendererFeature<TShaderProperties>.
  3. Add the renderer feature to a URP renderer asset.

Methods

AddRenderPasses(ScriptableRenderer, ref RenderingData)

Injects one or multiple ScriptableRenderPass in the renderer.

public override void AddRenderPasses(ScriptableRenderer renderer, ref RenderingData renderingData)

Parameters

renderer ScriptableRenderer

Renderer used for adding render passes.

renderingData RenderingData

Rendering state. Use this to setup render passes.

Create()

Initializes this feature's resources. This is called every time serialization happens.

public override void Create()

CreateSimplePass(string, Action<Material>, bool, bool)

Creates a pass from a name and a function that sets the material properties.

protected ScriptableRenderPass CreateSimplePass(string passName, Action<Material> setMaterialProperties, bool requiresNormals = false, bool requiresDepth = false)

Parameters

passName string

The name of the pass, used for command buffer naming.

setMaterialProperties Action<Material>

A function that sets the material properties for the effect.

requiresNormals bool

Whether this effect requires the normals texture.

requiresDepth bool

Whether this effect requires the depth texture.

Returns

ScriptableRenderPass

Remarks

You can use this method to implement Gamelogic.Fx.URP.PostProcessing.PostProcessRendererFeature<TShaderProperties>.GetPass().

Dispose(bool)

protected override void Dispose(bool disposing)

Parameters

disposing bool