Struct RenderGraphBuilder
Use this struct to set up a new Render Pass.
Namespace: UnityEngine.Experimental.Rendering.RenderGraphModule
Syntax
public struct RenderGraphBuilder : IDisposable
Methods
CreateTransientTexture(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(TextureHandle)
Create a new Render Graph Texture resource using the descriptor from another texture.
Declaration
public TextureHandle CreateTransientTexture(TextureHandle texture)
Parameters
| Type | Name | Description |
|---|---|---|
| TextureHandle | texture | Texture from which the descriptor should be used. |
Returns
| Type | Description |
|---|---|
| TextureHandle | A new transient TextureHandle. |
Dispose()
Dispose the RenderGraphBuilder instance.
Declaration
public void Dispose()
EnableAsyncCompute(Boolean)
Enable asynchronous compute for this pass.
Declaration
public void EnableAsyncCompute(bool value)
Parameters
| Type | Name | Description |
|---|---|---|
| Boolean | value | Set to true to enable asynchronous compute. |
ReadComputeBuffer(ComputeBufferHandle)
Specify a Compute Buffer resource to read from during the pass.
Declaration
public ComputeBufferHandle ReadComputeBuffer(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(TextureHandle)
Specify a Texture resource to read from during the pass.
Declaration
public TextureHandle ReadTexture(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. |
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(TextureHandle, Int32)
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(TextureHandle input, int index)
Parameters
| Type | Name | Description |
|---|---|---|
| TextureHandle | input | The Texture resource to use as a color render target. |
| Int32 | index | Index for multiple render target usage. |
Returns
| Type | Description |
|---|---|
| TextureHandle | An updated resource handle to the input resource. |
UseDepthBuffer(TextureHandle, DepthAccess)
Specify that the pass will use a Texture resource as a depth buffer.
Declaration
public TextureHandle UseDepthBuffer(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(RendererListHandle)
Specify a Renderer List resource to use during the pass.
Declaration
public RendererListHandle UseRendererList(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(ComputeBufferHandle)
Specify a Compute Buffer resource to write to during the pass.
Declaration
public ComputeBufferHandle WriteComputeBuffer(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(TextureHandle)
Specify a Texture resource to write to during the pass.
Declaration
public TextureHandle WriteTexture(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. |