Log inGet started
Package

temporalAntiAliasing.module

Newest version

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

README.md

temporalAntiAliasing

Runtime control of the scene's temporal antialiasing.

local temporalAntiAliasing = require("@builtin::systems.antiAliasing.temporalAntiAliasing")

temporalAntiAliasing.enable({ historyWeight = 0.9, sharpness = 0.2 })
temporalAntiAliasing.get()
temporalAntiAliasing.active()
temporalAntiAliasing.disable()

enable creates the pass if it is not running and applies the settings; any field left out keeps its current value. disable releases the pass and returns the projection to sampling pixel centres, keeping the settings so a later enable brings back the same tuning.

For antialiasing that persists with the scene, add the TemporalAntiAliasing component instead — it drives this module from fields you can edit in the inspector. A world created from the default template turns it on as it loads (antialiasing = "taa" under [render] in its .world_settings, tuned by [render.taa]); setting antialiasing = "off" there keeps it off.

Settings

fieldeffect
historyWeightHow much of the accumulated result to keep each frame. Higher resolves more detail and settles smoother, at the cost of taking longer to let go of what a surface used to look like. Clamped short of 1, where the accumulation would stop taking in the frame being drawn.
neighbourhoodClampHow far outside the neighbourhood's own colour spread an accumulated sample may sit before it is pulled back in. Lower rejects more, trading some of the settling for a result that follows change faster.
sharpnessHow strongly the shown picture is sharpened, in [0, 1]. The sharpening (rcas) runs on display-referred values after the display transform, steepens edges without lifting either side past its plateau, and is never written back into the accumulation, so it cannot compound from frame to frame. 0 shows the accumulation as it is.
motionRejectionHow much fast motion shortens the memory. A reprojection over a long distance is the most likely to have crossed onto another surface, so weighting the current frame up there is what stops a moving object trailing behind itself.
stillSamplesHow many renders a pixel whose surface holds still accumulates, in [1, 256]. Each render samples a different point inside the pixel, so a still pixel holding several whole passes through the sample sequence settles on their average instead of rippling as the samples visit it; fewer let a still picture follow a slow change of its lighting sooner.

Choosing between this and edge antialiasing

Both are in this package and they correct different things.

antiAliasing (FXAA) works from the finished frame alone. It finds each edge and shifts that pixel's sample across it, which fixes the staircase in a still image at a fixed cost, and knows nothing about time — so a highlight that flashes on and off between frames still flashes.

This one accumulates real samples, so it corrects what no single frame can see: the crawling and flickering that only exist in motion, and sub-pixel detail no one sample lands on. It needs the scene's velocity to do it, and pays for it with a small amount of softening, which sharpness puts back.

Running both is reasonable — FXAA cleans up the edges within a frame while the accumulation handles what happens between them.