Class PostProcessRenderContext
A context object passed around all post-processing effects in a frame.
Namespace: UnityEngine.Rendering.PostProcessing
Syntax
public sealed class PostProcessRenderContext : object
Properties
antialiasing
The current anti-aliasing method used by the camera.
Declaration
public PostProcessLayer.Antialiasing antialiasing { get; }
Property Value
Type | Description |
---|---|
PostProcessLayer.Antialiasing |
camera
The camera currently being rendered.
Declaration
public Camera camera { get; set; }
Property Value
Type | Description |
---|---|
Camera |
command
The command buffer to fill render commands in.
Declaration
public CommandBuffer command { get; set; }
Property Value
Type | Description |
---|---|
CommandBuffer |
debugLayer
A reference to the internal debug layer.
Declaration
public PostProcessDebugLayer debugLayer { get; }
Property Value
Type | Description |
---|---|
PostProcessDebugLayer |
destination
The destination target for this pass (can't be the same as source).
Declaration
public RenderTargetIdentifier destination { get; set; }
Property Value
Type | Description |
---|---|
RenderTargetIdentifier |
flip
Should we flip the last pass?
Declaration
public bool flip { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
height
The current camera height (in pixels).
Declaration
public int height { get; }
Property Value
Type | Description |
---|---|
Int32 |
isSceneView
Are we currently rendering in the scene view?
Declaration
public bool isSceneView { get; }
Property Value
Type | Description |
---|---|
Boolean |
numberOfEyes
The number of eyes for XR outputs.
Declaration
public int numberOfEyes { get; }
Property Value
Type | Description |
---|---|
Int32 |
propertySheets
The property sheet factory handled by the currently active PostProcessLayer.
Declaration
public PropertySheetFactory propertySheets { get; }
Property Value
Type | Description |
---|---|
PropertySheetFactory |
resources
The resource asset contains reference to external resources (shaders, textures...).
Declaration
public PostProcessResources resources { get; }
Property Value
Type | Description |
---|---|
PostProcessResources |
screenHeight
The height of the logical screen size.
Declaration
public int screenHeight { get; }
Property Value
Type | Description |
---|---|
Int32 |
screenWidth
The width of the logical screen size.
Declaration
public int screenWidth { get; }
Property Value
Type | Description |
---|---|
Int32 |
source
The source target for this pass (can't be the same as destination).
Declaration
public RenderTargetIdentifier source { get; set; }
Property Value
Type | Description |
---|---|
RenderTargetIdentifier |
sourceFormat
The texture format used for the source target.
Declaration
public RenderTextureFormat sourceFormat { get; set; }
Property Value
Type | Description |
---|---|
RenderTextureFormat |
stereoActive
Is stereo rendering active?
Declaration
public bool stereoActive { get; }
Property Value
Type | Description |
---|---|
Boolean |
stereoRenderingMode
The current rendering mode for XR.
Declaration
public PostProcessRenderContext.StereoRenderingMode stereoRenderingMode { get; }
Property Value
Type | Description |
---|---|
PostProcessRenderContext.StereoRenderingMode |
temporalAntialiasing
A reference to the temporal anti-aliasing settings for the rendering layer. This is mostly used to grab the jitter vector and other TAA-related values when an effect needs to do temporal reprojection.
Declaration
public TemporalAntialiasing temporalAntialiasing { get; }
Property Value
Type | Description |
---|---|
TemporalAntialiasing |
userData
A dictionary to store custom user data objects. This is handy to share data between custom effects.
Declaration
public Dictionary<string, object> userData { get; }
Property Value
Type | Description |
---|---|
Dictionary<String, Object> |
width
The current camera width (in pixels).
Declaration
public int width { get; }
Property Value
Type | Description |
---|---|
Int32 |
xrActiveEye
The current active rendering eye (for XR).
Declaration
public int xrActiveEye { get; }
Property Value
Type | Description |
---|---|
Int32 |
Methods
GetScreenSpaceTemporaryRT(CommandBuffer, Int32, Int32, RenderTextureFormat, RenderTextureReadWrite, FilterMode, Int32, Int32)
Grabs a temporary render target with the current display size.
Declaration
public void GetScreenSpaceTemporaryRT(CommandBuffer cmd, int nameID, int depthBufferBits = 0, RenderTextureFormat colorFormat = null, RenderTextureReadWrite readWrite = null, FilterMode filter = null, int widthOverride = 0, int heightOverride = 0)
Parameters
Type | Name | Description |
---|---|---|
CommandBuffer | cmd | The command buffer to grab a render target from |
Int32 | nameID | The shader property name for this texture |
Int32 | depthBufferBits | The number of bits to use for the depth buffer |
RenderTextureFormat | colorFormat | The render texture format |
RenderTextureReadWrite | readWrite | The color space conversion mode |
FilterMode | filter | The texture filtering mode |
Int32 | widthOverride | Override the display width; use |
Int32 | heightOverride | Override the display height; use |
GetScreenSpaceTemporaryRT(Int32, RenderTextureFormat, RenderTextureReadWrite, Int32, Int32)
Grabs a temporary render target with the current display size.
Declaration
public RenderTexture GetScreenSpaceTemporaryRT(int depthBufferBits = 0, RenderTextureFormat colorFormat = null, RenderTextureReadWrite readWrite = null, int widthOverride = 0, int heightOverride = 0)
Parameters
Type | Name | Description |
---|---|---|
Int32 | depthBufferBits | The number of bits to use for the depth buffer |
RenderTextureFormat | colorFormat | The render texture format |
RenderTextureReadWrite | readWrite | The color space conversion mode |
Int32 | widthOverride | Override the display width; use |
Int32 | heightOverride | Override the display height; use |
Returns
Type | Description |
---|---|
RenderTexture | A temporary render target |
IsDebugOverlayEnabled(DebugOverlay)
Checks if a specific debug overlay is enabled.
Declaration
public bool IsDebugOverlayEnabled(DebugOverlay overlay)
Parameters
Type | Name | Description |
---|---|---|
DebugOverlay | overlay | The debug overlay to look for |
Returns
Type | Description |
---|---|
Boolean |
|
IsTemporalAntialiasingActive()
Checks if temporal anti-aliasing is supported and enabled.
Declaration
public bool IsTemporalAntialiasingActive()
Returns
Type | Description |
---|---|
Boolean |
|
PushDebugOverlay(CommandBuffer, RenderTargetIdentifier, PropertySheet, Int32)
Blit a source render target to the debug overlay target. This is a direct shortcut to PushDebugOverlay(CommandBuffer, RenderTargetIdentifier, PropertySheet, Int32).
Declaration
public void PushDebugOverlay(CommandBuffer cmd, RenderTargetIdentifier source, PropertySheet sheet, int pass)
Parameters
Type | Name | Description |
---|---|---|
CommandBuffer | cmd | The command buffer to send render commands to |
RenderTargetIdentifier | source | The source target |
PropertySheet | sheet | The property sheet to use for the blit |
Int32 | pass | The pass to use for the property sheet |
See Also
Reset()
Resets the state of this context object. This is called by the render pipeline on every frame and allows re-using the same context object between frames without having to recreate a new one.
Declaration
public void Reset()
UpdateSinglePassStereoState(Boolean, Boolean, Boolean)
Update current single-pass stereo state for TAA, AO, etc.
Declaration
public void UpdateSinglePassStereoState(bool isTAAEnabled, bool isAOEnabled, bool isSSREnabled)
Parameters
Type | Name | Description |
---|---|---|
Boolean | isTAAEnabled | The enabled state of Temporal Anti-aliasing |
Boolean | isAOEnabled | The enabled state of Ambient Occlusion |
Boolean | isSSREnabled | The enabled state of Screen-space Reflections |