Class ScriptableRenderPass
ScriptableRenderPass
implements a logical rendering pass that can be used to extend Universal RP renderer.
Implements
Inherited Members
Namespace: UnityEngine.Rendering.Universal
Assembly: Unity.RenderPipelines.Universal.Runtime.dll
Syntax
public abstract class ScriptableRenderPass : IRenderGraphRecorder
Constructors
ScriptableRenderPass()
Creates a new ScriptableRenderPass"
instance.
Declaration
public ScriptableRenderPass()
Properties
clearColor
The color value to use when clearing.
Declaration
public Color clearColor { get; }
Property Value
Type | Description |
---|---|
Color |
clearFlag
The flag to use when clearing.
Declaration
public ClearFlag clearFlag { get; }
Property Value
Type | Description |
---|---|
ClearFlag |
See Also
colorAttachmentHandle
The main color attachment handle.
Declaration
public RTHandle colorAttachmentHandle { get; }
Property Value
Type | Description |
---|---|
RTHandle |
colorAttachmentHandles
List for the g-buffer attachment handles.
Declaration
public RTHandle[] colorAttachmentHandles { get; }
Property Value
Type | Description |
---|---|
RTHandle[] |
colorStoreActions
The store actions for Color.
Declaration
public RenderBufferStoreAction[] colorStoreActions { get; }
Property Value
Type | Description |
---|---|
RenderBufferStoreAction[] |
depthAttachmentHandle
The depth attachment handle.
Declaration
public RTHandle depthAttachmentHandle { get; }
Property Value
Type | Description |
---|---|
RTHandle |
depthStoreAction
The store actions for Depth.
Declaration
public RenderBufferStoreAction depthStoreAction { get; }
Property Value
Type | Description |
---|---|
RenderBufferStoreAction |
input
The input requirements for the ScriptableRenderPass
, which has been set using ConfigureInput
Declaration
public ScriptableRenderPassInput input { get; }
Property Value
Type | Description |
---|---|
ScriptableRenderPassInput |
See Also
passName
The name of the pass that will show up in profiler and other tools. This will be indentical to the
name of profilingSampler
. profilingSampler
is set to null in the release build (non-development)
so this passName
property is the safe way to access the name and use it consistently. This will always return a valid string.
Declaration
protected string passName { get; }
Property Value
Type | Description |
---|---|
string |
profilingSampler
A ProfilingSampler for the entire render pass. Used as a profiling name by ScriptableRenderer
when executing the pass.
The default is named as the class type of the sub-class.
Set base.profilingSampler
from the sub-class constructor to set a different profiling name for a custom ScriptableRenderPass
This returns null in release build (non-development).
.
Declaration
protected ProfilingSampler profilingSampler { get; set; }
Property Value
Type | Description |
---|---|
ProfilingSampler |
renderPassEvent
The event when the render pass executes.
Declaration
public RenderPassEvent renderPassEvent { get; set; }
Property Value
Type | Description |
---|---|
RenderPassEvent |
requiresIntermediateTexture
Setting this property to true forces rendering of all passes in the URP frame via an intermediate texture. Use this option for passes that do not support rendering directly to the backbuffer or that require sampling the active color target. Using this option might have a significant performance impact on untethered VR platforms.
Declaration
public bool requiresIntermediateTexture { get; set; }
Property Value
Type | Description |
---|---|
bool |
Methods
ConfigureInput(ScriptableRenderPassInput)
Configures Input Requirements for this render pass.
This method should be called inside ScriptableRendererFeature.AddRenderPasses
.
Declaration
public void ConfigureInput(ScriptableRenderPassInput passInput)
Parameters
Type | Name | Description |
---|---|---|
ScriptableRenderPassInput | passInput | ScriptableRenderPassInput containing information about what requirements the pass needs. |
See Also
CreateDrawingSettings(List<ShaderTagId>, ref RenderingData, SortingCriteria)
Creates DrawingSettings
based on current rendering state.
Declaration
public DrawingSettings CreateDrawingSettings(List<ShaderTagId> shaderTagIdList, ref RenderingData renderingData, SortingCriteria sortingCriteria)
Parameters
Type | Name | Description |
---|---|---|
List<ShaderTagId> | shaderTagIdList | List of shader pass tag to render. |
RenderingData | renderingData | Current rendering state. |
SortingCriteria | sortingCriteria | Criteria to sort objects being rendered. |
Returns
Type | Description |
---|---|
DrawingSettings | Returns the draw settings created. |
See Also
CreateDrawingSettings(List<ShaderTagId>, UniversalRenderingData, UniversalCameraData, UniversalLightData, SortingCriteria)
Creates DrawingSettings
based on current rendering state.
Declaration
public DrawingSettings CreateDrawingSettings(List<ShaderTagId> shaderTagIdList, UniversalRenderingData renderingData, UniversalCameraData cameraData, UniversalLightData lightData, SortingCriteria sortingCriteria)
Parameters
Type | Name | Description |
---|---|---|
List<ShaderTagId> | shaderTagIdList | List of shader pass tag to render. |
UniversalRenderingData | renderingData | Current rendering state. |
UniversalCameraData | cameraData | Current camera state. |
UniversalLightData | lightData | Current light state. |
SortingCriteria | sortingCriteria | Criteria to sort objects being rendered. |
Returns
Type | Description |
---|---|
DrawingSettings | Returns the draw settings created. |
See Also
CreateDrawingSettings(ShaderTagId, ref RenderingData, SortingCriteria)
Creates DrawingSettings
based on current the rendering state.
Declaration
public DrawingSettings CreateDrawingSettings(ShaderTagId shaderTagId, ref RenderingData renderingData, SortingCriteria sortingCriteria)
Parameters
Type | Name | Description |
---|---|---|
ShaderTagId | shaderTagId | Shader pass tag to render. |
RenderingData | renderingData | Current rendering state. |
SortingCriteria | sortingCriteria | Criteria to sort objects being rendered. |
Returns
Type | Description |
---|---|
DrawingSettings | Returns the draw settings created. |
See Also
CreateDrawingSettings(ShaderTagId, UniversalRenderingData, UniversalCameraData, UniversalLightData, SortingCriteria)
Creates DrawingSettings
based on current the rendering state.
Declaration
public DrawingSettings CreateDrawingSettings(ShaderTagId shaderTagId, UniversalRenderingData renderingData, UniversalCameraData cameraData, UniversalLightData lightData, SortingCriteria sortingCriteria)
Parameters
Type | Name | Description |
---|---|---|
ShaderTagId | shaderTagId | Shader pass tag to render. |
UniversalRenderingData | renderingData | Current rendering state. |
UniversalCameraData | cameraData | Current camera state. |
UniversalLightData | lightData | Current light state. |
SortingCriteria | sortingCriteria | Criteria to sort objects being rendered. |
Returns
Type | Description |
---|---|
DrawingSettings | Returns the draw settings created. |
See Also
OnCameraCleanup(CommandBuffer)
Called upon finish rendering a camera. You can use this callback to release any resources created by this render pass that need to be cleanup once camera has finished rendering. This method should be called for all cameras in a camera stack.
Declaration
public virtual void OnCameraCleanup(CommandBuffer cmd)
Parameters
Type | Name | Description |
---|---|---|
CommandBuffer | cmd | Use this CommandBuffer to cleanup any generated data |
RecordRenderGraph(RenderGraph, ContextContainer)
This function is called during render graph recording and allows the implementing class to register the relevant passes and resources to the passed in render graph. To access information about the current execution context (current camera, ...) the ContextContainer can be queried. See the render pipeline documentation for more information on the types that are available in the context container. (The exact types available may differ based on the currently active render pipeline). This is where custom rendering occurs. Specific details are left to the implementation.
Declaration
public virtual void RecordRenderGraph(RenderGraph renderGraph, ContextContainer frameData)
Parameters
Type | Name | Description |
---|---|---|
RenderGraph | renderGraph | The graph to register resources and passes with. |
ContextContainer | frameData | A ContextContainer that allows querying information about the current execution context (.e.g. RenderPipeline camera info). |
Operators
operator >(ScriptableRenderPass, ScriptableRenderPass)
Compares two instances of ScriptableRenderPass
by their RenderPassEvent
and returns if lhs
is executed after rhs
.
Declaration
public static bool operator >(ScriptableRenderPass lhs, ScriptableRenderPass rhs)
Parameters
Type | Name | Description |
---|---|---|
ScriptableRenderPass | lhs | |
ScriptableRenderPass | rhs |
Returns
Type | Description |
---|---|
bool |
operator <(ScriptableRenderPass, ScriptableRenderPass)
Compares two instances of ScriptableRenderPass
by their RenderPassEvent
and returns if lhs
is executed before rhs
.
Declaration
public static bool operator <(ScriptableRenderPass lhs, ScriptableRenderPass rhs)
Parameters
Type | Name | Description |
---|---|---|
ScriptableRenderPass | lhs | |
ScriptableRenderPass | rhs |
Returns
Type | Description |
---|---|
bool |