Log inGet started
Package

denoiser.assetType

Newest version

This package holds more than this page lists. See all of its files in its world.

README.md

denoiser (asset type)

A denoiser filters the noisy image a render pass wrote into a quieter image of the same size, by passes it adds to the frame being drawn. Every denoiser implements the denoiser interface (@builtin::interfaces.denoiser), so a render feature that takes one as a setting calls any of them the same way.

What a denoiser holds

myFilter.denoiser/
  init.luau                    # the parameters and the four members
  README.md                    # how it filters
  .metadata                    # description and tags
  myFilter_pass.computeShader/ # the compute shaders it dispatches (any number)

init.luau returns a table:

KeyWhat it is
settingsOptional. The denoiser's parameters, as Field descriptors (Field.scaled ones follow the device's quality level).
denoise(owner, ctx, signal, opts, values)Adds the passes that filter signal to ctx at opts.phase, from opts.order, and answers the guid of the filtered image. values are the parameters in force: each setting's default, then opts.values, at the quality level in force.
orders(owner, values)How many consecutive orders denoise takes with these values.
restart(owner)The owner's next denoise starts from its own frame.
free(owner)Frees what the owner holds.

owner keys everything the denoiser keeps from frame to frame. A render feature's passes run once for every view the frame draws, so history kept in history targets (renderer.texture.create { history = true }) is kept per view as well.

~.<name> inside the folder names the denoiser's own compute shaders, wherever it is installed:

local temporal = asset.resolve("~.myFilter_temporal", "computeShader")

Using one

-- a render feature's settings
denoiser = Field.interfaceRef("denoiser", "@builtin::systems.denoising.svgf", NoSync,
    "The denoiser the noisy term goes through."),

-- in render(ctx)
local d = ctx.settings.denoiser:as("denoiser")
local clean = d:denoise("myFeature", ctx, noisy.guid, { phase = "afterOpaqueLit", order = 20 })
local nextOrder = 20 + d:orders("myFeature")

@builtin::systems.denoising.svgf is the built-in one.