docs.unity.cn
    Show / Hide Table of Contents

    Interface IRasterRenderGraphBuilder

    A builder for a raster render pass AddRasterRenderPass<PassData>(String, out PassData)

    Inherited Members
    IBaseRenderGraphBuilder.UseTexture(TextureHandle, IBaseRenderGraphBuilder.AccessFlags)
    IBaseRenderGraphBuilder.UseBuffer(BufferHandle, IBaseRenderGraphBuilder.AccessFlags)
    IBaseRenderGraphBuilder.CreateTransientTexture(TextureDesc)
    IBaseRenderGraphBuilder.CreateTransientTexture(TextureHandle)
    IBaseRenderGraphBuilder.CreateTransientBuffer(BufferDesc)
    IBaseRenderGraphBuilder.CreateTransientBuffer(BufferHandle)
    IBaseRenderGraphBuilder.UseRendererList(RendererListHandle)
    IBaseRenderGraphBuilder.EnableAsyncCompute(Boolean)
    IBaseRenderGraphBuilder.AllowPassCulling(Boolean)
    IBaseRenderGraphBuilder.AllowGlobalStateModification(Boolean)
    IDisposable.Dispose()
    Namespace: UnityEngine.Experimental.Rendering.RenderGraphModule
    Syntax
    public interface IRasterRenderGraphBuilder : IBaseRenderGraphBuilder, IDisposable

    Methods

    SetRenderFunc<PassData>(BaseRenderFunc<PassData, RasterGraphContext>)

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

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

    Render function for the pass.

    Type Parameters
    Name Description
    PassData

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

    UseTextureFragment(TextureHandle, Int32, IBaseRenderGraphBuilder.AccessFlags)

    Use the texture as an rendertarget attachment.

    Writing: Indicate this pass will write a texture through rendertarget rasterization writes. The graph will automatically bind the texture as an MRT output on the indicated index slot. Write in shader as float4 out : SV_Target{index} = value; This texture always needs to be written as an render target (SV_Targetx) writing using other methods (like operator[] = ) may not work even if using the current fragment+sampleIdx pos. When using operator[] please use the UseTexture function instead. Reading: Indicates this pass will read a texture on the current fragment position but not unnecessarily modify it. Although not explicitly visible in shader code Reading may happen depending on the rasterization state, e.g. Blending (read and write) or Z-Testing (read only) may read the buffer.

    Note: The rendergraph does not know what content will be rendered in the bound texture. By default it assumes only partial data is written (e.g. a small rectangle is drawn on the screen) so it will preserve the existing rendertarget content (e.g. behind/around the triangle) if you know you will write the full screen the AccessFlags.WriteAll should be used instead as it will give better performance.

    Declaration
    TextureHandle UseTextureFragment(TextureHandle tex, int index, IBaseRenderGraphBuilder.AccessFlags flags = IBaseRenderGraphBuilder.AccessFlags.Write)
    Parameters
    Type Name Description
    TextureHandle tex

    Texture to use during this pass.

    Int32 index

    Index the shader will use to access this texture.

    IBaseRenderGraphBuilder.AccessFlags flags

    How this pass will acess the texture. Default value is set to AccessFlag.Write

    Returns
    Type Description
    TextureHandle

    A explicitly versioned handle representing the latest version of the pased in texture. Note that except for special cases where you want to refer to a specific version return value is generally discarded.

    UseTextureFragmentDepth(TextureHandle, IBaseRenderGraphBuilder.AccessFlags)

    Use the texture as a depth buffer for the Z-Buffer hardware. Note you can only test-against and write-to a single depth texture in a pass. If you want to write depth to more than one texture you will need to register the second texture as UseTextureFragment and manually calculate and write the depth value in the shader. Calling UseTextureFragmentDepth twice on the same builder is an error. Write: Indicate a texture will be written with the current fragment depth by the ROPs (but not for depth reading (i.e. z-test == always)). Read: Indicate a texture will be used as an input for the depth testing unit.

    Declaration
    TextureHandle UseTextureFragmentDepth(TextureHandle tex, IBaseRenderGraphBuilder.AccessFlags flags = IBaseRenderGraphBuilder.AccessFlags.Write)
    Parameters
    Type Name Description
    TextureHandle tex

    Texture to use during this pass.

    IBaseRenderGraphBuilder.AccessFlags flags

    How this pass will acess the texture. Default value is set to AccessFlag.Write

    Returns
    Type Description
    TextureHandle

    A explicitly versioned handle representing the latest version of the pased in texture. Note that except for special cases where you want to refer to a specific version return value is generally discarded.

    UseTextureFragmentInput(TextureHandle, Int32, IBaseRenderGraphBuilder.AccessFlags)

    Use the texture as an input attachment.

    This informs the graph that any shaders in pass will only read from this texture at the current fragment position using the LOAD_FRAMEBUFFER_INPUT(idx)/LOAD_FRAMEBUFFER_INPUT_MS(idx,sampleIdx) macros. The index passed to LOAD_FRAMEBUFFER_INPUT needs to match the index passed to UseTextureFragmentInput for this texture.

    Declaration
    TextureHandle UseTextureFragmentInput(TextureHandle tex, int index, IBaseRenderGraphBuilder.AccessFlags flags = IBaseRenderGraphBuilder.AccessFlags.Read)
    Parameters
    Type Name Description
    TextureHandle tex

    Texture to use during this pass.

    Int32 index

    Index the shader will use to access this texture.

    IBaseRenderGraphBuilder.AccessFlags flags

    How this pass will acess the texture. Default value is set to AccessFlag.Read. Writing is currently not supported on any platform.

    Returns
    Type Description
    TextureHandle

    A explicitly versioned handle representing the latest version of the pased in texture. Note that except for special cases where you want to refer to a specific version return value is generally discarded.

    Extension Methods

    AnalyticsUtils.ToNestedColumnWithDefault<T>(T, T, Boolean)
    ReflectionUtils.Invoke(Object, String, Object[])
    ReflectionUtils.SetField(Object, String, Object)
    ReflectionUtils.GetField(Object, String)
    ReflectionUtils.GetFields(Object)
    Back to top Copyright © 2023 Unity Technologies — Terms of use
    Generated by DocFX
    on 26 September 2023