docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class ScriptableRenderPass

    ScriptableRenderPass implements a logical rendering pass that can be used to extend Universal RP renderer.

    Inheritance
    object
    ScriptableRenderPass
    DrawSkyboxPass
    AdditionalLightsShadowCasterPass
    ColorGradingLutPass
    CopyColorPass
    CopyDepthPass
    DepthNormalOnlyPass
    DepthOnlyPass
    DrawObjectsPass
    FinalBlitPass
    MainLightShadowCasterPass
    RenderObjectsPass
    XRDepthMotionPass
    XROcclusionMeshPass
    Implements
    IRenderGraphRecorder
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    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
    ClearFlag

    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
    ConfigureInput(ScriptableRenderPassInput)

    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
    AddRenderPasses(ScriptableRenderer, ref RenderingData)

    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
    DrawingSettings

    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
    DrawingSettings

    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
    DrawingSettings

    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
    DrawingSettings

    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)

    Declaration
    public virtual void RecordRenderGraph(RenderGraph renderGraph, ContextContainer frameData)
    Parameters
    Type Name Description
    RenderGraph renderGraph
    ContextContainer frameData

    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

    Implements

    IRenderGraphRecorder

    Did you find this page useful? Please give it a rating:

    Thanks for rating this page!

    Report a problem on this page

    What kind of problem would you like to report?

    • This page needs code samples
    • Code samples do not work
    • Information is missing
    • Information is incorrect
    • Information is unclear or confusing
    • There is a spelling/grammar error on this page
    • Something else

    Thanks for letting us know! This page has been marked for review based on your feedback.

    If you have time, you can provide more information to help us fix the problem faster.

    Provide more information

    You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:

    You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:

    You've told us there is information missing from this page. Please tell us more about what's missing:

    You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:

    You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:

    You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:

    You've told us this page has a problem. Please tell us more about what's wrong:

    Thank you for helping to make the Unity documentation better!

    Your feedback has been submitted as a ticket for our documentation team to review.

    We are not able to reply to every ticket submitted.

    In This Article
    • Constructors
      • ScriptableRenderPass()
    • Properties
      • clearColor
      • clearFlag
      • colorAttachmentHandle
      • colorAttachmentHandles
      • colorStoreActions
      • depthAttachmentHandle
      • depthStoreAction
      • input
      • passName
      • profilingSampler
      • renderPassEvent
      • requiresIntermediateTexture
    • Methods
      • ConfigureInput(ScriptableRenderPassInput)
      • CreateDrawingSettings(List<ShaderTagId>, ref RenderingData, SortingCriteria)
      • CreateDrawingSettings(List<ShaderTagId>, UniversalRenderingData, UniversalCameraData, UniversalLightData, SortingCriteria)
      • CreateDrawingSettings(ShaderTagId, ref RenderingData, SortingCriteria)
      • CreateDrawingSettings(ShaderTagId, UniversalRenderingData, UniversalCameraData, UniversalLightData, SortingCriteria)
      • OnCameraCleanup(CommandBuffer)
      • RecordRenderGraph(RenderGraph, ContextContainer)
    • Operators
      • operator >(ScriptableRenderPass, ScriptableRenderPass)
      • operator <(ScriptableRenderPass, ScriptableRenderPass)
    • Implements
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)