Class ScriptableRenderPass
ScriptableRenderPass implements a logical rendering pass that can be used to extend LWRP renderer.
Inheritance
Namespace: UnityEngine.Rendering.LWRP
Syntax
public abstract class ScriptableRenderPass
Constructors
ScriptableRenderPass()
Declaration
public ScriptableRenderPass()
Properties
clearColor
Declaration
public Color clearColor { get; }
Property Value
| Type | Description |
|---|---|
| Color |
clearFlag
Declaration
public ClearFlag clearFlag { get; }
Property Value
| Type | Description |
|---|---|
| ClearFlag |
colorAttachment
Declaration
public RenderTargetIdentifier colorAttachment { get; }
Property Value
| Type | Description |
|---|---|
| RenderTargetIdentifier |
depthAttachment
Declaration
public RenderTargetIdentifier depthAttachment { get; }
Property Value
| Type | Description |
|---|---|
| RenderTargetIdentifier |
renderPassEvent
Declaration
public RenderPassEvent renderPassEvent { get; set; }
Property Value
| Type | Description |
|---|---|
| RenderPassEvent |
Methods
Blit(CommandBuffer, RenderTargetIdentifier, RenderTargetIdentifier, Material, Int32)
Add a blit command to the context for execution. This changes the active render target in the ScriptableRenderer to destination.
Declaration
public void Blit(CommandBuffer cmd, RenderTargetIdentifier source, RenderTargetIdentifier destination, Material material = null, int passIndex = 0)
Parameters
| Type | Name | Description |
|---|---|---|
| CommandBuffer | cmd | Command buffer to record command for execution. |
| RenderTargetIdentifier | source | Source texture or target identifier to blit from. |
| RenderTargetIdentifier | destination | Destination texture or target identifier to blit into. This becomes the renderer active render target. |
| Material | material | Material to use. |
| System.Int32 | passIndex | Shader pass to use. Default is 0. |
See Also
Configure(CommandBuffer, RenderTextureDescriptor)
Declaration
public virtual void Configure(CommandBuffer cmd, RenderTextureDescriptor cameraTextureDescriptor)
Parameters
| Type | Name | Description |
|---|---|---|
| CommandBuffer | cmd | |
| RenderTextureDescriptor | cameraTextureDescriptor |
ConfigureClear(ClearFlag, Color)
Declaration
public void ConfigureClear(ClearFlag clearFlag, Color clearColor)
Parameters
| Type | Name | Description |
|---|---|---|
| ClearFlag | clearFlag | |
| Color | clearColor |
ConfigureTarget(RenderTargetIdentifier)
Declaration
public void ConfigureTarget(RenderTargetIdentifier colorAttachment)
Parameters
| Type | Name | Description |
|---|---|---|
| RenderTargetIdentifier | colorAttachment |
ConfigureTarget(RenderTargetIdentifier, RenderTargetIdentifier)
Declaration
public void ConfigureTarget(RenderTargetIdentifier colorAttachment, RenderTargetIdentifier depthAttachment)
Parameters
| Type | Name | Description |
|---|---|---|
| RenderTargetIdentifier | colorAttachment | |
| RenderTargetIdentifier | depthAttachment |
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 |
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 |
|---|---|---|
| System.Collections.Generic.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 |
Execute(ScriptableRenderContext, ref RenderingData)
Execute the pass. This is where custom rendering occurs. Specific details are left to the implementation
Declaration
public abstract void Execute(ScriptableRenderContext context, ref RenderingData renderingData)
Parameters
| Type | Name | Description |
|---|---|---|
| ScriptableRenderContext | context | Use this render context to issue any draw commands during execution |
| RenderingData | renderingData | Current rendering state information |
FrameCleanup(CommandBuffer)
Cleanup any allocated data that was created during the execution of the pass.
Declaration
public virtual void FrameCleanup(CommandBuffer cmd)
Parameters
| Type | Name | Description |
|---|---|---|
| CommandBuffer | cmd | Use this CommandBuffer to cleanup any generated data |
RenderPostProcessing(CommandBuffer, ref CameraData, RenderTextureDescriptor, RenderTargetIdentifier, RenderTargetIdentifier, Boolean, Boolean)
Adds a Render Post-processing command for execution. This changes the active render target in the ScriptableRenderer to destination.
Declaration
public void RenderPostProcessing(CommandBuffer cmd, ref CameraData cameraData, RenderTextureDescriptor sourceDescriptor, RenderTargetIdentifier source, RenderTargetIdentifier destination, bool opaqueOnly, bool flip)
Parameters
| Type | Name | Description |
|---|---|---|
| CommandBuffer | cmd | Command buffer to record command for execution. |
| CameraData | cameraData | Camera rendering data. |
| RenderTextureDescriptor | sourceDescriptor | Render texture descriptor for source. |
| RenderTargetIdentifier | source | Source texture or render target identifier. |
| RenderTargetIdentifier | destination | Destination texture or render target identifier. |
| System.Boolean | opaqueOnly | If true, only renders opaque post-processing effects. Otherwise, renders before and after stack post-processing effects. |
| System.Boolean | flip | If true, flips image vertically. |
Operators
GreaterThan(ScriptableRenderPass, ScriptableRenderPass)
Declaration
public static bool operator>(ScriptableRenderPass lhs, ScriptableRenderPass rhs)
Parameters
| Type | Name | Description |
|---|---|---|
| ScriptableRenderPass | lhs | |
| ScriptableRenderPass | rhs |
Returns
| Type | Description |
|---|---|
| System.Boolean |
LessThan(ScriptableRenderPass, ScriptableRenderPass)
Declaration
public static bool operator <(ScriptableRenderPass lhs, ScriptableRenderPass rhs)
Parameters
| Type | Name | Description |
|---|---|---|
| ScriptableRenderPass | lhs | |
| ScriptableRenderPass | rhs |
Returns
| Type | Description |
|---|---|
| System.Boolean |