Capítulo 493 de 859

Chapter 493: TAAUNode

Core Idea

A special node that performs Temporal Anti-Aliasing Upscaling (TAAU).

Like TRAA, the node accumulates jittered samples over multiple frames and reprojects history with motion vectors. Unlike TRAA, the input buffers (beauty, depth, velocity) are expected to be rendered at a lower resolution than the renderer's drawing buffer — typically by lowering the upstream pass's resolution via PassNode#setResolutionScale — and the resolve pass reconstructs an output-resolution image using a 9-tap Blackman-Harris filter (Gaussian approximation) over the jittered input samples. The result is an alternative to FSR2/3 that does anti-aliasing and upscaling in a single pass.

References:

Note: MSAA must be disabled when TAAU is in use.

Key Concepts

  • beautyNode : TextureNode: The texture node that represents the input of the effect.
  • camera : Camera: The camera the scene is rendered with.
  • currentFrameWeight : number: Baseline weight applied to the current frame in the resolve. Lower values produce smoother results with longer accumulation but slower conv…
  • depthNode : TextureNode: A node that represents the scene's depth.
  • depthThreshold : number: When the difference between the current and previous depth goes above this threshold, the history is considered invalid.
  • edgeDepthDiff : number: The depth difference within the 3×3 neighborhood to consider a pixel as an edge.
  • isTAAUNode : boolean (readonly): This flag can be used for type testing.
  • maxVelocityLength : number: The history becomes invalid as the pixel length of the velocity approaches this value.
  • updateBeforeType : string: The updateBeforeType is set to NodeUpdateType.FRAME since the node renders its effect once per frame in updateBefore().
  • velocityNode : TextureNode: A node that represents the scene's velocity.

Code Examples

import { taau } from 'three/addons/tsl/display/TAAUNode.js';
  • What it demonstrates: Typical usage of TAAUNode.

Reference Tables

Constructor

Signature
new TAAUNode( beautyNode : TextureNode, depthNode : TextureNode, velocityNode : TextureNode, camera : Camera )

Properties

PropertyDescription
.beautyNode : TextureNodeThe texture node that represents the input of the effect.
.camera : CameraThe camera the scene is rendered with.
.currentFrameWeight : numberBaseline weight applied to the current frame in the resolve. Lower values produce smoother results with longer accumulation but slower convergence on disoccluded regions; the motion factor is added o…
.depthNode : TextureNodeA node that represents the scene's depth.
.depthThreshold : numberWhen the difference between the current and previous depth goes above this threshold, the history is considered invalid.
.edgeDepthDiff : numberThe depth difference within the 3×3 neighborhood to consider a pixel as an edge.
.isTAAUNode : boolean (readonly)This flag can be used for type testing.
.maxVelocityLength : numberThe history becomes invalid as the pixel length of the velocity approaches this value.
.updateBeforeType : stringThe updateBeforeType is set to NodeUpdateType.FRAME since the node renders its effect once per frame in updateBefore().
.velocityNode : TextureNodeA node that represents the scene's velocity.

Methods

MethodDescription
.clearViewOffset()Clears the view offset from the scene's camera.
.dispose()Frees internal resources. This method should be called when the effect is no longer required.
.getTextureNode() : PassTextureNodeReturns the result of the effect as a texture node.
.setSize( outputWidth : number, outputHeight : number )Sets the output size of the effect (history and resolve targets). The previous-depth texture is sized independently in updateBefore() to track the scene's current depth texture.
.setViewOffset( inputWidth : number, inputHeight : number )Defines the TAAU's current jitter as a view offset to the scene's camera. The jitter is shrunk to one output pixel (rather than one input pixel) so that the halton sequence gradually fills the outp…
.setup( builder : NodeBuilder ) : PassTextureNodeThis method is used to setup the effect's render targets and TSL code.
.updateBefore( frame : NodeFrame )This method is used to render the effect once per frame.

Key Takeaways

  1. TAAUNode extends: EventDispatcher → Node → TempNode
  2. Most relevant properties: beautyNode, camera, currentFrameWeight, depthNode.
  3. Key methods: clearViewOffset, dispose, getTextureNode, setSize.

Connects To