docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct RenderGraphBuilder

    Use this struct to set up a new Render Pass.

    Implements
    IDisposable
    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    ValueType.ToString()
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: UnityEngine.Experimental.Rendering.RenderGraphModule
    Assembly: Unity.RenderPipelines.Core.Runtime.dll
    Syntax
    public struct RenderGraphBuilder : IDisposable

    Methods

    AllowPassCulling(bool)

    Allow or not pass culling By default all passes can be culled out if the render graph detects it's not actually used. In some cases, a pass may not write or read any texture but rather do something with side effects (like setting a global texture parameter for example). This function can be used to tell the system that it should not cull this pass.

    Declaration
    public void AllowPassCulling(bool value)
    Parameters
    Type Name Description
    bool value

    True to allow pass culling.

    AllowRendererListCulling(bool)

    Allow or not pass culling based on renderer list results By default all passes can be culled out if the render graph detects they are using a renderer list that is empty (does not draw any geometry) In some cases, a pass may not write or read any texture but rather do something with side effects (like setting a global texture parameter for example). This function can be used to tell the system that it should not cull this pass.

    Declaration
    public void AllowRendererListCulling(bool value)
    Parameters
    Type Name Description
    bool value

    True to allow pass culling.

    CreateTransientComputeBuffer(in ComputeBufferDesc)

    Create a new Render Graph Compute Buffer resource. This Compute Buffer will only be available for the current pass and will be assumed to be both written and read so users don't need to add explicit read/write declarations.

    Declaration
    public ComputeBufferHandle CreateTransientComputeBuffer(in ComputeBufferDesc desc)
    Parameters
    Type Name Description
    ComputeBufferDesc desc

    Compute Buffer descriptor.

    Returns
    Type Description
    ComputeBufferHandle

    A new transient ComputeBufferHandle.

    CreateTransientComputeBuffer(in ComputeBufferHandle)

    Create a new Render Graph Compute Buffer resource using the descriptor from another Compute Buffer. This Compute Buffer will only be available for the current pass and will be assumed to be both written and read so users don't need to add explicit read/write declarations.

    Declaration
    public ComputeBufferHandle CreateTransientComputeBuffer(in ComputeBufferHandle computebuffer)
    Parameters
    Type Name Description
    ComputeBufferHandle computebuffer

    Compute Buffer from which the descriptor should be used.

    Returns
    Type Description
    ComputeBufferHandle

    A new transient ComputeBufferHandle.

    CreateTransientTexture(in TextureDesc)

    Create a new Render Graph Texture resource. This texture will only be available for the current pass and will be assumed to be both written and read so users don't need to add explicit read/write declarations.

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

    Texture descriptor.

    Returns
    Type Description
    TextureHandle

    A new transient TextureHandle.

    CreateTransientTexture(in TextureHandle)

    Create a new Render Graph Texture resource using the descriptor from another texture. This texture will only be available for the current pass and will be assumed to be both written and read so users don't need to add explicit read/write declarations.

    Declaration
    public TextureHandle CreateTransientTexture(in TextureHandle texture)
    Parameters
    Type Name Description
    TextureHandle texture

    Texture from which the descriptor should be used.

    Returns
    Type Description
    TextureHandle

    A new transient TextureHandle.

    DependsOn(in RendererListHandle)

    Used to indicate that a pass depends on an external renderer list (that is not directly used in this pass).

    Declaration
    public RendererListHandle DependsOn(in RendererListHandle input)
    Parameters
    Type Name Description
    RendererListHandle input

    The renderer list handle this pass depends on.

    Returns
    Type Description
    RendererListHandle

    RendererListHandle

    Dispose()

    Dispose the RenderGraphBuilder instance.

    Declaration
    public void Dispose()

    EnableAsyncCompute(bool)

    Enable asynchronous compute for this pass.

    Declaration
    public void EnableAsyncCompute(bool value)
    Parameters
    Type Name Description
    bool value

    Set to true to enable asynchronous compute.

    ReadComputeBuffer(in ComputeBufferHandle)

    Specify a Compute Buffer resource to read from during the pass.

    Declaration
    public ComputeBufferHandle ReadComputeBuffer(in ComputeBufferHandle input)
    Parameters
    Type Name Description
    ComputeBufferHandle input

    The Compute Buffer resource to read from during the pass.

    Returns
    Type Description
    ComputeBufferHandle

    An updated resource handle to the input resource.

    ReadTexture(in TextureHandle)

    Specify a Texture resource to read from during the pass.

    Declaration
    public TextureHandle ReadTexture(in TextureHandle input)
    Parameters
    Type Name Description
    TextureHandle input

    The Texture resource to read from during the pass.

    Returns
    Type Description
    TextureHandle

    An updated resource handle to the input resource.

    ReadWriteTexture(in TextureHandle)

    Specify a Texture resource to read and write to during the pass.

    Declaration
    public TextureHandle ReadWriteTexture(in TextureHandle input)
    Parameters
    Type Name Description
    TextureHandle input

    The Texture resource to read and write to during the pass.

    Returns
    Type Description
    TextureHandle

    An updated resource handle to the input resource.

    SetRenderFunc<PassData>(RenderFunc<PassData>)

    Specify the render function to use for this pass. A call to this is mandatory for the pass to be valid.

    Declaration
    public void SetRenderFunc<PassData>(RenderFunc<PassData> renderFunc) where PassData : class, new()
    Parameters
    Type Name Description
    RenderFunc<PassData> renderFunc

    Render function for the pass.

    Type Parameters
    Name Description
    PassData

    The Type of the class that provides data to the Render Pass.

    UseColorBuffer(in TextureHandle, int)

    Specify that the pass will use a Texture resource as a color render target. This has the same effect as WriteTexture and also automatically sets the Texture to use as a render target.

    Declaration
    public TextureHandle UseColorBuffer(in TextureHandle input, int index)
    Parameters
    Type Name Description
    TextureHandle input

    The Texture resource to use as a color render target.

    int index

    Index for multiple render target usage.

    Returns
    Type Description
    TextureHandle

    An updated resource handle to the input resource.

    UseDepthBuffer(in TextureHandle, DepthAccess)

    Specify that the pass will use a Texture resource as a depth buffer.

    Declaration
    public TextureHandle UseDepthBuffer(in TextureHandle input, DepthAccess flags)
    Parameters
    Type Name Description
    TextureHandle input

    The Texture resource to use as a depth buffer during the pass.

    DepthAccess flags

    Specify the access level for the depth buffer. This allows you to say whether you will read from or write to the depth buffer, or do both.

    Returns
    Type Description
    TextureHandle

    An updated resource handle to the input resource.

    UseRendererList(in RendererListHandle)

    Specify a Renderer List resource to use during the pass.

    Declaration
    public RendererListHandle UseRendererList(in RendererListHandle input)
    Parameters
    Type Name Description
    RendererListHandle input

    The Renderer List resource to use during the pass.

    Returns
    Type Description
    RendererListHandle

    An updated resource handle to the input resource.

    WriteComputeBuffer(in ComputeBufferHandle)

    Specify a Compute Buffer resource to write to during the pass.

    Declaration
    public ComputeBufferHandle WriteComputeBuffer(in ComputeBufferHandle input)
    Parameters
    Type Name Description
    ComputeBufferHandle input

    The Compute Buffer resource to write to during the pass.

    Returns
    Type Description
    ComputeBufferHandle

    An updated resource handle to the input resource.

    WriteTexture(in TextureHandle)

    Specify a Texture resource to write to during the pass.

    Declaration
    public TextureHandle WriteTexture(in TextureHandle input)
    Parameters
    Type Name Description
    TextureHandle input

    The Texture resource to write to during the pass.

    Returns
    Type Description
    TextureHandle

    An updated resource handle to the input resource.

    Implements

    IDisposable
    In This Article
    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)