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.
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()
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
passNamestringThe name of the pass, used for command buffer naming.
setMaterialPropertiesAction<Material>A function that sets the material properties for the effect.
requiresNormalsboolWhether this effect requires the normals texture.
requiresDepthboolWhether 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
disposingbool