docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class RenderGraph

    This class is the main entry point of the Render Graph system.

    Inheritance
    object
    RenderGraph
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEngine.Rendering.RenderGraphModule
    Assembly: Unity.RenderPipelines.Core.Runtime.dll
    Syntax
    [MovedFrom(true, "UnityEngine.Experimental.Rendering.RenderGraphModule", "UnityEngine.Rendering.RenderGraphModule", null)]
    public class RenderGraph

    Constructors

    RenderGraph(string)

    Render Graph constructor.

    Declaration
    public RenderGraph(string name = "RenderGraph")
    Parameters
    Type Name Description
    string name

    Optional name used to identify the render graph instnace.

    Fields

    kMaxMRTCount

    Maximum number of MRTs supported by Render Graph.

    Declaration
    public static readonly int kMaxMRTCount
    Field Value
    Type Description
    int

    Properties

    defaultResources

    Set of default resources usable in a pass rendering code.

    Declaration
    public RenderGraphDefaultResources defaultResources { get; }
    Property Value
    Type Description
    RenderGraphDefaultResources

    isRenderGraphViewerActive

    If true, the Render Graph Viewer is active.

    Declaration
    public static bool isRenderGraphViewerActive { get; }
    Property Value
    Type Description
    bool

    name

    Name of the Render Graph.

    Declaration
    public string name { get; }
    Property Value
    Type Description
    string

    nativeRenderPassesEnabled

    Enable the use of the render pass API by the graph instead of traditional SetRenderTarget. This is an advanced feature and users have to be aware of the specific impact it has on rendergraph/graphics APIs below.

    When enabled, the render graph try to use render passes and supasses instead of relying on SetRendertarget. It will try to aggressively optimize the number of BeginRenderPass+EndRenderPass calls as well as calls to NextSubPass. This with the aim to maximize the time spent "on chip" on tile based renderers.

    The Graph will automatically determine when to break render passes as well as the load and store actions to apply to these render passes. To do this, the graph will analyze the use of textures. E.g. when a texture is used twice in a row as a active render target, the two render graph passes will be merged in a single render pass with two surpasses. On the other hand if a render target is sampled as a texture in a later pass this render target will be stored (and possibly resolved) and the render pass will be broken up.

    When setting this setting to true some existing render graph API is no longer valid as it can't express detailed frame information needed to emit native render pases. In particular:

    • The ImportBackbuffer overload without a RenderTargetInfo argument.
    • Any AddRenderPass overloads. The more specific AddRasterRenderPass/AddComputePass/AddUnsafePass functions should be used to register passes.

    In addition to this, additional validation will be done on the correctness of arguments of existing API that was not previously done. This could lead to new errors when using existing render graph code with nativeRenderPassesEnabled.

    Note: that CommandBuffer.BeginRenderPass/EndRenderPass calls are different by design from SetRenderTarget so this could also have effects outside of render graph (e.g. for code relying on the currently active render target as this will not be updated when using render passes).

    Declaration
    public bool nativeRenderPassesEnabled { get; set; }
    Property Value
    Type Description
    bool

    Methods

    AddComputePass<PassData>(string, out PassData)

    Add a new Compute Render Pass to the Render Graph. Raster passes can execute rasterization workloads but cannot do other GPU work like copies or compute.

    Declaration
    public IComputeRenderGraphBuilder AddComputePass<PassData>(string passName, out PassData passData)
    Parameters
    Type Name Description
    string passName

    Name of the new Render Pass (this is also be used to generate a GPU profiling marker).

    PassData passData

    Instance of PassData that is passed to the render function and you must fill.

    Returns
    Type Description
    IComputeRenderGraphBuilder

    A new instance of a IRasterRenderGraphBuilder used to setup the new Rasterization Render Pass.

    Type Parameters
    Name Description
    PassData

    Type of the class to use to provide data to the Render Pass.

    AddComputePass<PassData>(string, out PassData, ProfilingSampler)

    Add a new Compute Render Pass to the Render Graph. Compute passes can execute compute workloads but cannot do rasterization.

    Declaration
    public IComputeRenderGraphBuilder AddComputePass<PassData>(string passName, out PassData passData, ProfilingSampler sampler)
    Parameters
    Type Name Description
    string passName

    Name of the new Render Pass (this is also be used to generate a GPU profiling marker).

    PassData passData

    Instance of PassData that is passed to the render function and you must fill.

    ProfilingSampler sampler

    Profiling sampler used around the pass.

    Returns
    Type Description
    IComputeRenderGraphBuilder

    A new instance of a IComputeRenderGraphBuilder used to setup the new Compute Render Pass.

    Type Parameters
    Name Description
    PassData

    Type of the class to use to provide data to the Render Pass.

    AddRasterRenderPass<PassData>(string, out PassData)

    Add a new Raster Render Pass to the Render Graph. Raster passes can execute rasterization workloads but cannot do other GPU work like copies or compute.

    Declaration
    public IRasterRenderGraphBuilder AddRasterRenderPass<PassData>(string passName, out PassData passData)
    Parameters
    Type Name Description
    string passName

    Name of the new Render Pass (this is also be used to generate a GPU profiling marker).

    PassData passData

    Instance of PassData that is passed to the render function and you must fill.

    Returns
    Type Description
    IRasterRenderGraphBuilder

    A new instance of a IRasterRenderGraphBuilder used to setup the new Rasterization Render Pass.

    Type Parameters
    Name Description
    PassData

    Type of the class to use to provide data to the Render Pass.

    AddRasterRenderPass<PassData>(string, out PassData, ProfilingSampler)

    Add a new Raster Render Pass to the Render Graph. Raster passes can execute rasterization workloads but cannot do other GPU work like copies or compute.

    Declaration
    public IRasterRenderGraphBuilder AddRasterRenderPass<PassData>(string passName, out PassData passData, ProfilingSampler sampler)
    Parameters
    Type Name Description
    string passName

    Name of the new Render Pass (this is also be used to generate a GPU profiling marker).

    PassData passData

    Instance of PassData that is passed to the render function and you must fill.

    ProfilingSampler sampler

    Profiling sampler used around the pass.

    Returns
    Type Description
    IRasterRenderGraphBuilder

    A new instance of a IRasterRenderGraphBuilder used to setup the new Rasterization Render Pass.

    Type Parameters
    Name Description
    PassData

    Type of the class to use to provide data to the Render Pass.

    AddRenderPass<PassData>(string, out PassData)

    Add a new Render Pass to the Render Graph.

    Declaration
    public RenderGraphBuilder AddRenderPass<PassData>(string passName, out PassData passData)
    Parameters
    Type Name Description
    string passName

    Name of the new Render Pass (this is also be used to generate a GPU profiling marker).

    PassData passData

    Instance of PassData that is passed to the render function and you must fill.

    Returns
    Type Description
    RenderGraphBuilder

    A new instance of a RenderGraphBuilder used to setup the new Render Pass.

    Type Parameters
    Name Description
    PassData

    Type of the class to use to provide data to the Render Pass.

    AddRenderPass<PassData>(string, out PassData, ProfilingSampler)

    Add a new Render Pass to the Render Graph.

    Declaration
    public RenderGraphBuilder AddRenderPass<PassData>(string passName, out PassData passData, ProfilingSampler sampler)
    Parameters
    Type Name Description
    string passName

    Name of the new Render Pass (this is also be used to generate a GPU profiling marker).

    PassData passData

    Instance of PassData that is passed to the render function and you must fill.

    ProfilingSampler sampler

    Profiling sampler used around the pass.

    Returns
    Type Description
    RenderGraphBuilder

    A new instance of a RenderGraphBuilder used to setup the new Render Pass.

    Type Parameters
    Name Description
    PassData

    Type of the class to use to provide data to the Render Pass.

    AddUnsafePass<PassData>(string, out PassData)

    Add a new Unsafe Render Pass to the Render Graph. Unsafe passes can do certain operations compute/raster render passes cannot do and have access to the full command buffer API. The unsafe API should be used sparingly as it has the following downsides:

    • Limited automatic validation of the commands and resource dependencies. The user is responsible to ensure that all dependencies are correctly declared.
    • All native render passes will be serialized out.
    • In the future the render graph compiler may generate a sub-optimal command stream for unsafe passes. When using a unsafe pass the graph will also not automatically set up graphics state like rendertargets. The pass should do this itself using cmd.SetRenderTarget and related commands.
    Declaration
    public IUnsafeRenderGraphBuilder AddUnsafePass<PassData>(string passName, out PassData passData)
    Parameters
    Type Name Description
    string passName

    Name of the new Render Pass (this is also be used to generate a GPU profiling marker).

    PassData passData

    Instance of PassData that is passed to the render function and you must fill.

    Returns
    Type Description
    IUnsafeRenderGraphBuilder

    A new instance of a IUnsafeRenderGraphBuilder used to setup the new Unsafe Render Pass.

    Type Parameters
    Name Description
    PassData

    Type of the class to use to provide data to the Render Pass.

    AddUnsafePass<PassData>(string, out PassData, ProfilingSampler)

    Add a new unsafe Render Pass to the Render Graph. Unsafe passes can do certain operations compute/raster render passes cannot do and have access to the full command buffer API. The unsafe API should be used sparingly as it has the following downsides:

    • Limited automatic validation of the commands and resource dependencies. The user is responsible to ensure that all dependencies are correctly declared.
    • All native render passes will be serialized out.
    • In the future the render graph compiler may generate a sub-optimal command stream for unsafe passes. When using an unsafe pass the graph will also not automatically set up graphics state like rendertargets. The pass should do this itself using cmd.SetRenderTarget and related commands.
    Declaration
    public IUnsafeRenderGraphBuilder AddUnsafePass<PassData>(string passName, out PassData passData, ProfilingSampler sampler)
    Parameters
    Type Name Description
    string passName

    Name of the new Render Pass (this is also be used to generate a GPU profiling marker).

    PassData passData

    Instance of PassData that is passed to the render function and you must fill.

    ProfilingSampler sampler

    Profiling sampler used around the pass.

    Returns
    Type Description
    IUnsafeRenderGraphBuilder

    A new instance of a IUnsafeRenderGraphBuilder used to setup the new unsafe Render Pass.

    Type Parameters
    Name Description
    PassData

    Type of the class to use to provide data to the Render Pass.

    BeginProfilingSampler(ProfilingSampler, string, int)

    Begin a profiling scope.

    Declaration
    public void BeginProfilingSampler(ProfilingSampler sampler, string file = "", int line = 0)
    Parameters
    Type Name Description
    ProfilingSampler sampler

    Sampler used for profiling.

    string file

    File name of the source file this function is called from. Used for debugging. This parameter is automatically generated by the compiler. Users do not need to pass it.

    int line

    File line of the source file this function is called from. Used for debugging. This parameter is automatically generated by the compiler. Users do not need to pass it.

    BeginRecording(in RenderGraphParameters)

    Starts the recording of the render graph. This must be called before adding any pass to the render graph.

    Declaration
    public void BeginRecording(in RenderGraphParameters parameters)
    Parameters
    Type Name Description
    RenderGraphParameters parameters

    Parameters necessary for the render graph execution.

    Examples

    Begin recording the Render Graph.

    renderGraph.BeginRecording(parameters)
    // Add your render graph passes here.
    renderGraph.EndRecordingAndExecute()

    Cleanup()

    Cleanup the Render Graph.

    Declaration
    public void Cleanup()

    CreateBuffer(in BufferDesc)

    Create a new Render Graph Graphics Buffer resource.

    Declaration
    public BufferHandle CreateBuffer(in BufferDesc desc)
    Parameters
    Type Name Description
    BufferDesc desc

    Graphics Buffer descriptor.

    Returns
    Type Description
    BufferHandle

    A new GraphicsBufferHandle.

    CreateBuffer(in BufferHandle)

    Create a new Render Graph Graphics Buffer resource using the descriptor from another graphics buffer.

    Declaration
    public BufferHandle CreateBuffer(in BufferHandle graphicsBuffer)
    Parameters
    Type Name Description
    BufferHandle graphicsBuffer

    Graphics Buffer from which the descriptor should be used.

    Returns
    Type Description
    BufferHandle

    A new GraphicsBufferHandle.

    CreateGizmoRendererList(in Camera, in GizmoSubset)

    Creates a new Gizmo Renderer List Render Graph resource.

    Declaration
    public RendererListHandle CreateGizmoRendererList(in Camera camera, in GizmoSubset gizmoSubset)
    Parameters
    Type Name Description
    Camera camera

    The camera that is used for rendering the Gizmo.

    GizmoSubset gizmoSubset

    GizmoSubset that specifies whether gizmos render before or after postprocessing for a camera render.

    Returns
    Type Description
    RendererListHandle

    A new RendererListHandle.

    CreateRendererList(in RendererListParams)

    Creates a new Renderer List Render Graph resource.

    Declaration
    public RendererListHandle CreateRendererList(in RendererListParams desc)
    Parameters
    Type Name Description
    RendererListParams desc

    Renderer List descriptor.

    Returns
    Type Description
    RendererListHandle

    A new RendererListHandle.

    CreateRendererList(in RendererListDesc)

    Creates a new Renderer List Render Graph resource.

    Declaration
    public RendererListHandle CreateRendererList(in RendererListDesc desc)
    Parameters
    Type Name Description
    RendererListDesc desc

    Renderer List descriptor.

    Returns
    Type Description
    RendererListHandle

    A new RendererListHandle.

    CreateShadowRendererList(ref ShadowDrawingSettings)

    Creates a new Shadow Renderer List Render Graph resource.

    Declaration
    public RendererListHandle CreateShadowRendererList(ref ShadowDrawingSettings shadowDrawingSettings)
    Parameters
    Type Name Description
    ShadowDrawingSettings shadowDrawingSettings

    DrawSettings that describe the shadow drawcall.

    Returns
    Type Description
    RendererListHandle

    A new RendererListHandle.

    CreateSharedTexture(in TextureDesc, bool)

    Create a new Render Graph Shared Texture resource. This texture will be persistent across render graph executions.

    Declaration
    public TextureHandle CreateSharedTexture(in TextureDesc desc, bool explicitRelease = false)
    Parameters
    Type Name Description
    TextureDesc desc

    Creation descriptor of the texture.

    bool explicitRelease

    Set to true if you want to manage the lifetime of the resource yourself. Otherwise the resource will be released automatically if unused for a time.

    Returns
    Type Description
    TextureHandle

    A new TextureHandle.

    CreateSkyboxRendererList(in Camera)

    Creates a new Skybox Renderer List Render Graph resource.

    Declaration
    public RendererListHandle CreateSkyboxRendererList(in Camera camera)
    Parameters
    Type Name Description
    Camera camera

    The camera that is used for rendering the Skybox.

    Returns
    Type Description
    RendererListHandle

    A new RendererListHandle.

    CreateSkyboxRendererList(in Camera, Matrix4x4, Matrix4x4)

    Creates a new Skybox Renderer List Render Graph resource.

    Declaration
    public RendererListHandle CreateSkyboxRendererList(in Camera camera, Matrix4x4 projectionMatrix, Matrix4x4 viewMatrix)
    Parameters
    Type Name Description
    Camera camera

    The camera that is used for rendering the Skybox.

    Matrix4x4 projectionMatrix

    The projection matrix used during XR rendering of the skybox.

    Matrix4x4 viewMatrix

    The view matrix used during XR rendering of the skybox.

    Returns
    Type Description
    RendererListHandle

    A new RendererListHandle.

    CreateSkyboxRendererList(in Camera, Matrix4x4, Matrix4x4, Matrix4x4, Matrix4x4)

    Creates a new Skybox Renderer List Render Graph resource.

    Declaration
    public RendererListHandle CreateSkyboxRendererList(in Camera camera, Matrix4x4 projectionMatrixL, Matrix4x4 viewMatrixL, Matrix4x4 projectionMatrixR, Matrix4x4 viewMatrixR)
    Parameters
    Type Name Description
    Camera camera

    The camera that is used for rendering the Skybox.

    Matrix4x4 projectionMatrixL

    The left eye projection matrix used during Legacy single pass XR rendering of the skybox.

    Matrix4x4 viewMatrixL

    The left eye view matrix used during Legacy single pass XR rendering of the skybox.

    Matrix4x4 projectionMatrixR

    The right eye projection matrix used during Legacy single pass XR rendering of the skybox.

    Matrix4x4 viewMatrixR

    The right eye view matrix used during Legacy single pass XR rendering of the skybox.

    Returns
    Type Description
    RendererListHandle

    A new RendererListHandle.

    CreateTexture(in TextureDesc)

    Create a new Render Graph Texture resource.

    Declaration
    public TextureHandle CreateTexture(in TextureDesc desc)
    Parameters
    Type Name Description
    TextureDesc desc

    Texture descriptor.

    Returns
    Type Description
    TextureHandle

    A new TextureHandle.

    CreateTexture(TextureHandle)

    Create a new Render Graph Texture resource using the descriptor from another texture.

    Declaration
    public TextureHandle CreateTexture(TextureHandle texture)
    Parameters
    Type Name Description
    TextureHandle texture

    Texture from which the descriptor should be used.

    Returns
    Type Description
    TextureHandle

    A new TextureHandle.

    CreateTextureIfInvalid(in TextureDesc, ref TextureHandle)

    Create a new Render Graph Texture if the passed handle is invalid and use said handle as output. If the passed handle is valid, no texture is created.

    Declaration
    public void CreateTextureIfInvalid(in TextureDesc desc, ref TextureHandle texture)
    Parameters
    Type Name Description
    TextureDesc desc

    Desc used to create the texture.

    TextureHandle texture

    Texture from which the descriptor should be used.

    CreateUIOverlayRendererList(in Camera)

    Creates a new UIOverlay Renderer List Render Graph resource.

    Declaration
    public RendererListHandle CreateUIOverlayRendererList(in Camera camera)
    Parameters
    Type Name Description
    Camera camera

    The camera that is used for rendering the full UIOverlay.

    Returns
    Type Description
    RendererListHandle

    A new RendererListHandle.

    CreateUIOverlayRendererList(in Camera, in UISubset)

    Creates a new UIOverlay Renderer List Render Graph resource.

    Declaration
    public RendererListHandle CreateUIOverlayRendererList(in Camera camera, in UISubset uiSubset)
    Parameters
    Type Name Description
    Camera camera

    The camera that is used for rendering some subset of the UIOverlay.

    UISubset uiSubset

    Enum flag that specifies which subset to render.

    Returns
    Type Description
    RendererListHandle

    A new RendererListHandle.

    CreateWireOverlayRendererList(in Camera)

    Creates a new WireOverlay Renderer List Render Graph resource.

    Declaration
    public RendererListHandle CreateWireOverlayRendererList(in Camera camera)
    Parameters
    Type Name Description
    Camera camera

    The camera that is used for rendering the WireOverlay.

    Returns
    Type Description
    RendererListHandle

    A new RendererListHandle.

    EndFrame()

    End frame processing. Purge resources that have been used since last frame and resets internal states. This need to be called once per frame.

    Declaration
    public void EndFrame()

    EndProfilingSampler(ProfilingSampler, string, int)

    End a profiling scope.

    Declaration
    public void EndProfilingSampler(ProfilingSampler sampler, string file = "", int line = 0)
    Parameters
    Type Name Description
    ProfilingSampler sampler

    Sampler used for profiling.

    string file

    File name of the source file this function is called from. Used for debugging. This parameter is automatically generated by the compiler. Users do not need to pass it.

    int line

    File line of the source file this function is called from. Used for debugging. This parameter is automatically generated by the compiler. Users do not need to pass it.

    EndRecordingAndExecute()

    Ends the recording and executes the render graph. This must be called once all passes have been added to the render graph.

    Declaration
    public void EndRecordingAndExecute()

    GetBufferDesc(in BufferHandle)

    Gets the descriptor of the specified Graphics Buffer resource.

    Declaration
    public BufferDesc GetBufferDesc(in BufferHandle graphicsBuffer)
    Parameters
    Type Name Description
    BufferHandle graphicsBuffer

    Graphics Buffer resource from which the descriptor is requested.

    Returns
    Type Description
    BufferDesc

    The input graphics buffer descriptor.

    GetRegisteredRenderGraphs()

    Get the list of all registered render graphs.

    Declaration
    public static List<RenderGraph> GetRegisteredRenderGraphs()
    Returns
    Type Description
    List<RenderGraph>

    The list of all registered render graphs.

    GetRenderTargetInfo(TextureHandle)

    Gets the descriptor of the specified Texture resource.

    Declaration
    public RenderTargetInfo GetRenderTargetInfo(TextureHandle texture)
    Parameters
    Type Name Description
    TextureHandle texture

    Texture resource from which the descriptor is requested.

    Returns
    Type Description
    RenderTargetInfo

    The input texture descriptor.

    GetTextureDesc(TextureHandle)

    Gets the descriptor of the specified Texture resource.

    Declaration
    public TextureDesc GetTextureDesc(TextureHandle texture)
    Parameters
    Type Name Description
    TextureHandle texture

    Texture resource from which the descriptor is requested.

    Returns
    Type Description
    TextureDesc

    The input texture descriptor.

    ImportBackbuffer(RenderTargetIdentifier)

    Import the final backbuffer to render graph. This function can only be used when nativeRenderPassesEnabled is false.

    Declaration
    public TextureHandle ImportBackbuffer(RenderTargetIdentifier rt)
    Parameters
    Type Name Description
    RenderTargetIdentifier rt

    Backbuffer render target identifier.

    Returns
    Type Description
    TextureHandle

    A new TextureHandle that represents the imported texture in the context of this rendergraph.

    ImportBackbuffer(RenderTargetIdentifier, RenderTargetInfo, ImportResourceParams)

    Import the final backbuffer to render graph. The rendergraph can't derive the properties of a RenderTargetIdentifier as it is an opaque handle so the user has to pass them in through the info argument.

    Declaration
    public TextureHandle ImportBackbuffer(RenderTargetIdentifier rt, RenderTargetInfo info, ImportResourceParams importParams = default)
    Parameters
    Type Name Description
    RenderTargetIdentifier rt

    Backbuffer render target identifier.

    RenderTargetInfo info

    The properties of the passed in RTHandle.

    ImportResourceParams importParams

    Info describing the clear behavior of imported textures. Clearing textures using importParams may be more efficient than manually clearing the texture using cmd.Clear on some hardware.

    Returns
    Type Description
    TextureHandle

    A new TextureHandle that represents the imported texture in the context of this rendergraph.

    ImportBuffer(GraphicsBuffer, bool)

    Import an external Graphics Buffer to the Render Graph. Any pass writing to an imported graphics buffer will be considered having side effects and can't be automatically culled.

    Declaration
    public BufferHandle ImportBuffer(GraphicsBuffer graphicsBuffer, bool forceRelease = false)
    Parameters
    Type Name Description
    GraphicsBuffer graphicsBuffer

    External Graphics Buffer that needs to be imported.

    bool forceRelease

    The imported graphics buffer will be released after usage.

    Returns
    Type Description
    BufferHandle

    A new GraphicsBufferHandle.

    ImportRayTracingAccelerationStructure(in RayTracingAccelerationStructure, string)

    Import an external RayTracingAccelerationStructure to the Render Graph. Any pass writing to (building) an imported RayTracingAccelerationStructure will be considered having side effects and can't be automatically culled.

    Declaration
    public RayTracingAccelerationStructureHandle ImportRayTracingAccelerationStructure(in RayTracingAccelerationStructure accelStruct, string name = null)
    Parameters
    Type Name Description
    RayTracingAccelerationStructure accelStruct

    External RayTracingAccelerationStructure that needs to be imported.

    string name

    Optional name for identifying the RayTracingAccelerationStructure in the Render Graph.

    Returns
    Type Description
    RayTracingAccelerationStructureHandle

    A new RayTracingAccelerationStructureHandle.

    ImportTexture(RTHandle)

    Import an external texture to the Render Graph. Any pass writing to an imported texture will be considered having side effects and can't be automatically culled.

    Declaration
    public TextureHandle ImportTexture(RTHandle rt)
    Parameters
    Type Name Description
    RTHandle rt

    External RTHandle that needs to be imported.

    Returns
    Type Description
    TextureHandle

    A new TextureHandle that represents the imported texture in the context of this rendergraph.

    ImportTexture(RTHandle, ImportResourceParams)

    Import an external texture to the Render Graph. Any pass writing to an imported texture will be considered having side effects and can't be automatically culled.

    Note: RTHandles that wrap RenderTargetIdentifier will fail to import using this overload as render graph can't derive the render texture's properties. In that case the overload taking a RenderTargetInfo argument should be used instead.

    Declaration
    public TextureHandle ImportTexture(RTHandle rt, ImportResourceParams importParams)
    Parameters
    Type Name Description
    RTHandle rt

    External RTHandle that needs to be imported.

    ImportResourceParams importParams

    Info describing the clear behavior of imported textures. Clearing textures using importParams may be more efficient than manually clearing the texture using cmd.Clear on some hardware.

    Returns
    Type Description
    TextureHandle

    A new TextureHandle that represents the imported texture in the context of this rendergraph.

    ImportTexture(RTHandle, RenderTargetInfo, ImportResourceParams)

    Import an external texture to the Render Graph. This overload should be used for RTHandles wrapping a RenderTargetIdentifier. If the RTHandle is wrapping a RenderTargetIdentifer, Rendergrpah can't derive the render texture's properties so the user has to provide this info to the graph through RenderTargetInfo.

    Any pass writing to an imported texture will be considered having side effects and can't be automatically culled.

    Note: To avoid inconsistencies between the passed in RenderTargetInfo and render texture this overload can only be used when the RTHandle is wrapping a RenderTargetIdentifier. If this is not the case, the overload of ImportTexture without a RenderTargetInfo argument should be used instead.

    Declaration
    public TextureHandle ImportTexture(RTHandle rt, RenderTargetInfo info, ImportResourceParams importParams = default)
    Parameters
    Type Name Description
    RTHandle rt

    External RTHandle that needs to be imported.

    RenderTargetInfo info

    The properties of the passed in RTHandle.

    ImportResourceParams importParams

    Info describing the clear behavior of imported textures. Clearing textures using importParams may be more efficient than manually clearing the texture using cmd.Clear on some hardware.

    Returns
    Type Description
    TextureHandle

    A new TextureHandle that represents the imported texture in the context of this rendergraph.

    RefreshSharedTextureDesc(TextureHandle, in TextureDesc)

    Refresh a shared texture with a new descriptor.

    Declaration
    public void RefreshSharedTextureDesc(TextureHandle handle, in TextureDesc desc)
    Parameters
    Type Name Description
    TextureHandle handle

    Shared texture that needs to be updated.

    TextureDesc desc

    New Descriptor for the texture.

    RegisterDebug(Panel)

    Register the render graph to the debug window.

    Declaration
    public void RegisterDebug(DebugUI.Panel panel = null)
    Parameters
    Type Name Description
    DebugUI.Panel panel

    Optional debug panel to which the render graph debug parameters will be registered.

    ReleaseSharedTexture(TextureHandle)

    Release a Render Graph shared texture resource.

    Declaration
    public void ReleaseSharedTexture(TextureHandle texture)
    Parameters
    Type Name Description
    TextureHandle texture

    The handle to the texture that needs to be release.

    UnRegisterDebug()

    Unregister render graph from the debug window.

    Declaration
    public void UnRegisterDebug()

    Extension Methods

    ReflectionUtils.GetField(object, string)
    ReflectionUtils.GetFields(object)
    ReflectionUtils.Invoke(object, string, params object[])
    ReflectionUtils.SetField(object, string, object)
    AnalyticsUtils.ToNestedColumnWithDefault<T>(T, T, bool)
    AnalyticsUtils.ToNestedColumn<T>(T, T)
    RenderGraphUtils.AddBlitPass(RenderGraph, TextureHandle, TextureHandle, Vector2, Vector2, int, int, int, int, int, int, RenderGraphUtils.BlitFilterMode, string)
    RenderGraphUtils.AddBlitPass(RenderGraph, RenderGraphUtils.BlitMaterialParameters, string)
    RenderGraphUtils.AddCopyPass(RenderGraph, TextureHandle, TextureHandle, int, int, int, int, string)
    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)