docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class CopyDepthPass

    Copy the given depth buffer into the given destination depth buffer.

    You can use this pass to copy a depth buffer to a destination, so you can use it later in rendering. If the source texture has MSAA enabled, the pass uses a custom MSAA resolve. If the source texture does not have MSAA enabled, the pass uses a Blit or a Copy Texture operation, depending on what the current platform supports.

    Inheritance
    object
    ScriptableRenderPass
    CopyDepthPass
    Implements
    IRenderGraphRecorder
    Inherited Members
    ScriptableRenderPass.renderPassEvent
    ScriptableRenderPass.colorAttachmentHandles
    ScriptableRenderPass.colorAttachmentHandle
    ScriptableRenderPass.depthAttachmentHandle
    ScriptableRenderPass.colorStoreActions
    ScriptableRenderPass.depthStoreAction
    ScriptableRenderPass.input
    ScriptableRenderPass.clearFlag
    ScriptableRenderPass.clearColor
    ScriptableRenderPass.requiresIntermediateTexture
    ScriptableRenderPass.profilingSampler
    ScriptableRenderPass.ConfigureInput(ScriptableRenderPassInput)
    ScriptableRenderPass.RecordRenderGraph(RenderGraph, ContextContainer)
    ScriptableRenderPass.CreateDrawingSettings(ShaderTagId, ref RenderingData, SortingCriteria)
    ScriptableRenderPass.CreateDrawingSettings(ShaderTagId, UniversalRenderingData, UniversalCameraData, UniversalLightData, SortingCriteria)
    ScriptableRenderPass.CreateDrawingSettings(List<ShaderTagId>, ref RenderingData, SortingCriteria)
    ScriptableRenderPass.CreateDrawingSettings(List<ShaderTagId>, UniversalRenderingData, UniversalCameraData, UniversalLightData, SortingCriteria)
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEngine.Rendering.Universal.Internal
    Assembly: Unity.RenderPipelines.Universal.Runtime.dll
    Syntax
    public class CopyDepthPass : ScriptableRenderPass, IRenderGraphRecorder

    Constructors

    CopyDepthPass(RenderPassEvent, Shader, bool, bool, bool, string)

    Creates a new CopyDepthPass instance.

    Declaration
    public CopyDepthPass(RenderPassEvent evt, Shader copyDepthShader, bool shouldClear = false, bool copyToDepth = false, bool copyResolvedDepth = false, string customPassName = null)
    Parameters
    Type Name Description
    RenderPassEvent evt

    The RenderPassEvent to use.

    Shader copyDepthShader

    The Shader to use for copying the depth.

    bool shouldClear

    Controls whether it should do a clear before copying the depth.

    bool copyToDepth

    Controls whether it should do a copy to a depth format target.

    bool copyResolvedDepth

    Set to true if the source depth is MSAA resolved.

    string customPassName

    An optional custom profiling name to disambiguate multiple copy passes.

    See Also
    RenderPassEvent

    Methods

    Dispose()

    Cleans up resources used by the pass.

    Declaration
    public void Dispose()

    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 override void OnCameraCleanup(CommandBuffer cmd)
    Parameters
    Type Name Description
    CommandBuffer cmd

    Use this CommandBuffer to cleanup any generated data

    Overrides
    ScriptableRenderPass.OnCameraCleanup(CommandBuffer)

    Render(RenderGraph, ContextContainer, TextureHandle, TextureHandle, bool, string)

    Sets up the Copy Depth pass for RenderGraph execution

    Declaration
    public void Render(RenderGraph renderGraph, ContextContainer frameData, TextureHandle destination, TextureHandle source, bool bindAsCameraDepth = false, string passName = "Copy Depth")
    Parameters
    Type Name Description
    RenderGraph renderGraph

    The current RenderGraph used for recording and execution of a frame.

    ContextContainer frameData

    The renderer settings containing rendering data of the current frame.

    TextureHandle destination

    TextureHandle of the destination it will copy to.

    TextureHandle source

    TextureHandle of the source it will copy from.

    bool bindAsCameraDepth

    If this is true, the destination texture is bound as _CameraDepthTexture after the copy pass

    string passName

    The pass name used for debug and identifying the pass.

    Render(RenderGraph, TextureHandle, TextureHandle, UniversalResourceData, UniversalCameraData, bool, string)

    Sets up the Copy Depth pass for RenderGraph execution

    Declaration
    public void Render(RenderGraph renderGraph, TextureHandle destination, TextureHandle source, UniversalResourceData resourceData, UniversalCameraData cameraData, bool bindAsCameraDepth = false, string passName = "Copy Depth")
    Parameters
    Type Name Description
    RenderGraph renderGraph

    The current RenderGraph used for recording and execution of a frame.

    TextureHandle destination

    TextureHandle of the destination it will copy to.

    TextureHandle source

    TextureHandle of the source it will copy from.

    UniversalResourceData resourceData

    URP texture handles for the current frame.

    UniversalCameraData cameraData

    Camera settings for the current frame.

    bool bindAsCameraDepth

    If this is true, the destination texture is bound as _CameraDepthTexture after the copy pass

    string passName

    The pass name used for debug and identifying the pass.

    Setup(RTHandle, RTHandle)

    Configure the pass with the source and destination to execute on.

    Declaration
    public void Setup(RTHandle source, RTHandle destination)
    Parameters
    Type Name Description
    RTHandle source

    Source Render Target

    RTHandle destination

    Destination Render Target

    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)