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.

Properties

CustomCameraScopePredicate

A predicate that determines whether this feature should execute for a given camera. Only used when CameraScope is set to Custom.

public Func<CameraData, bool> CustomCameraScopePredicate { get; set; }

Property Value

Func<CameraData, bool>

Remarks

Assign this from a MonoBehaviour, for example in Awake:

var data = GetComponent<UniversalAdditionalCameraData>();
var feature = data.scriptableRenderer.GetRendererFeature<MyFeature>();
feature.CustomCameraScopePredicate = cameraData => cameraData.camera.CompareTag("MyTag");

If the predicate is not assigned, the feature will not execute on any camera.

Properties

public TShaderProperties Properties { get; }

Property Value

TShaderProperties

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()

Dispose(bool)

protected override void Dispose(bool disposing)

Parameters

disposing bool