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
    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)

    profilingSampler

    A ProfilingSampler for the entire render pass. Used as a profiling name by ScriptableRenderer when executing the pass. Default is Unnamed_ScriptableRenderPass. Set base.profilingSampler from the sub-class constructor to set a profiling name for a custom ScriptableRenderPass.

    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)

    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

    Implements

    UnityEngine.Rendering.RenderGraphModule.IRenderGraphRecorder
    In This Article
    Back to top
    Copyright © 2024 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)