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
TShaderPropertiesThe type that defines and applies the shader properties for this effect.
- Inheritance
-
ScriptableRendererFeaturePostProcessRendererFeature<TShaderProperties>
- Implements
- Derived
- Inherited Members
-
ScriptableRendererFeature.isActiveScriptableRendererFeature.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.nameObject.hideFlags
Remarks
This class is the URP counterpart to the built-in
PostProcess<TShaderProperties> component.
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:
- Create a subclass of ShaderProperties that defines the shader name and parameters.
- Create a concrete renderer feature inheriting from PostProcessRendererFeature<TShaderProperties>.
- 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
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
rendererScriptableRendererRenderer used for adding render passes.
renderingDataRenderingDataRendering 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
disposingbool