Temporal Antialiasing
Accumulate jittered samples from successive frames while following scene motion and rejecting
invalid history. createTAAShaderPassPipeline combines velocity reprojection, depth validation,
and neighborhood clamping to reduce spatial aliasing and temporal shimmer.
At a Glance
| Property | Value |
|---|---|
| Export | createTAAShaderPassPipeline |
| Backend | WebGPU |
| Render passes | Three: temporal resolve, resolved-color copy, and depth-history copy |
| Required bindings | depthTexture and velocityTexture |
| Persistent state | Renderer-owned color and depth history textures |
Usage
import {ShaderPassRenderer} from '@luma.gl/engine';
import {createTAAShaderPassPipeline, toneMapping} from '@luma.gl/effects';
const renderer = new ShaderPassRenderer(device, {
colorFormat: 'rgba16float',
shaderPasses: [createTAAShaderPassPipeline(), toneMapping]
});
renderer.renderToScreen({
sourceTexture: gBuffer.colorTexture,
bindings: gBuffer.getShaderPassBindings(),
uniforms: {
taaResolve: {
historyWeight: 0.9,
depthThreshold: 0.01,
currentJitter,
previousJitter
}
},
resetHistory: cameraCut
});
Parameters
| Parameter | Default | Description |
|---|---|---|
historyWeight | 0.9 | Fraction of valid accumulated history retained in the resolved color. |
depthThreshold | 0.01 | Maximum allowed difference between current and reprojected previous depth. |
currentJitter | [0, 0] | Current projection jitter in normalized image coordinates. |
previousJitter | [0, 0] | Previous projection jitter in normalized image coordinates. |
The history weight is limited to 0.98. The application must render the source scene with the
same projection jitter and provide matching velocity and depth attachments every frame.
How It Works
- Move each current pixel into the previous frame with its velocity and jitter delta.
- Reject history outside the screen or across a depth disocclusion.
- Clamp valid history to the current 3-by-3 color neighborhood.
- Blend the current color and bounded history, then save current depth for the next frame.
Call renderer.resetHistory() or pass resetHistory: true after resize, camera cuts, abrupt scene
replacement, or invalid velocity generation.
Related Effects
- FXAA smooths one display image without history or auxiliary attachments.
- Camera-Reprojection Antialiasing derives motion from camera matrices rather than a velocity texture.
- Motion Blur uses the same depth and velocity attachments for directional shutter blur.