Capítulo 475 de 859

Chapter 475: SMAANode

Core Idea

Post processing node for applying SMAA. Unlike FXAA, this node should be applied before converting colors to sRGB. SMAA should produce better results than FXAA but is also more expensive to execute.

Used Preset: SMAA 1x Medium (with color edge detection) Reference: https://github.com/iryoku/smaa/releases/tag/v2.8.

Key Concepts

  • textureNode : TextureNode: The texture node that represents the input of the effect.
  • updateBeforeType : string: The updateBeforeType is set to NodeUpdateType.FRAME since the node renders its effect once per frame in updateBefore().

Code Examples

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

Reference Tables

Constructor

Signature
new SMAANode( textureNode : TextureNode )

Properties

PropertyDescription
.textureNode : TextureNodeThe texture node that represents the input of the effect.
.updateBeforeType : stringThe updateBeforeType is set to NodeUpdateType.FRAME since the node renders its effect once per frame in updateBefore().

Methods

MethodDescription
.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( width : number, height : number )Sets the size of the effect.
.setup( builder : NodeBuilder ) : PassTextureNodeThis method is used to setup the effect's TSL code.
.updateBefore( frame : NodeFrame )This method is used to render the effect once per frame.

Key Takeaways

  1. SMAANode extends: EventDispatcher → Node → TempNode
  2. Most relevant properties: textureNode, updateBeforeType.
  3. Key methods: dispose, getTextureNode, setSize, setup.

Connects To