Class CommandBufferDenoiser
The Denoiser class exposes a public API for denoising images that are stored as render textures. The operations are asynchronous and are recorded in a command buffer.
Inherited Members
Namespace: UnityEngine .Rendering.Denoising
Assembly: Unity.Rendering.Denoising.Runtime.dll
Syntax
public class CommandBufferDenoiser : DenoiserBase
Methods
DenoiseRequest(CommandBuffer, string, RenderTexture)
Create a denoise request using a render texture as input.
Declaration
public DenoiserBase.State DenoiseRequest(CommandBuffer cmd, string type, RenderTexture src)
Parameters
Type | Name | Description |
---|---|---|
Command |
cmd | The command buffer where Unity records the denoise request. |
string | type | The type of data passed in the render texture. Supported options are color, albedo, normal, or flow. |
Render |
src | The input texture used for denoising. |
Returns
Type | Description |
---|---|
Denoiser |
The state of the denoising operation. The valid states are Success and Failure. |
GetResults(CommandBuffer, RenderTexture)
Retrieve the results of a denoise request.
Declaration
public DenoiserBase.State GetResults(CommandBuffer cmd, RenderTexture dst)
Parameters
Type | Name | Description |
---|---|---|
Command |
cmd | The command buffer where Unity records this operation. |
Render |
dst | The destination texture that receives the denoise results. |
Returns
Type | Description |
---|---|
Denoiser |
Returns the state of the operation, whether Success or Failure. |
Init(DenoiserType, int, int, int, int, FilterHint)
Create a new denoiser.
Declaration
public DenoiserBase.State Init(DenoiserType type, int width, int height, int tileX = 0, int tileY = 0, DenoiserBase.FilterHint filterHint = FilterHint.Default)
Parameters
Type | Name | Description |
---|---|---|
Denoiser |
type | The type of denoiser backend to create. |
int | width | The width of the image buffer to be denoised. |
int | height | The height of the image buffer to be denoised. |
int | tileX | Determines the width of tiles in pixels. 0 disables tiling. Use this parameter to divide the image buffer into tiles that match the amount of memory available on your GPU. |
int | tileY | Determines the height of tiles in pixels. 0 disables tiling. Use this parameter to divide the image buffer into tiles that match the amount of memory available on your GPU. |
Denoiser |
filterHint | The type of filter to use in the denoising operations (default or lightmap) |
Returns
Type | Description |
---|---|
Denoiser |
Returns the state of the operation, whether Success or Failure. |
QueryCompletion()
Query the completion of a denoise request.
Declaration
public DenoiserBase.State QueryCompletion()
Returns
Type | Description |
---|---|
Denoiser |
Returns Executing if the denoising operation is not yet completed. If denoising is completed, returns Success or Failure. |
WaitForCompletion(ScriptableRenderContext, CommandBuffer)
Wait until the denoise request has finished executing.
Declaration
public DenoiserBase.State WaitForCompletion(ScriptableRenderContext renderContext, CommandBuffer cmd)
Parameters
Type | Name | Description |
---|---|---|
Scriptable |
renderContext | The scriptable render context used for rendering. |
Command |
cmd | The command buffer where Unity records this operation. |
Returns
Type | Description |
---|---|
Denoiser |
Returns the state of the operation, whether Success or Failure. |