Capítulo 373 de 859

Chapter 373: AfterImageNode

Core Idea

Post processing node for creating an after image effect.

Key Concepts

  • damp : Node.<float>: How quickly the after-image fades. A higher value means the after-image persists longer, while a lower value means it fades faster. Should …
  • 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 { afterImage } from 'three/addons/tsl/display/AfterImageNode.js';
  • What it demonstrates: Typical usage of AfterImageNode.

Reference Tables

Constructor

Signature
new AfterImageNode( textureNode : TextureNode, damp : Node.<float> )

Properties

PropertyDescription
.damp : Node.<float>How quickly the after-image fades. A higher value means the after-image persists longer, while a lower value means it fades faster. Should be in the range [0, 1].
.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. AfterImageNode extends: EventDispatcher → Node → TempNode
  2. Most relevant properties: damp, textureNode, updateBeforeType.
  3. Key methods: dispose, getTextureNode, setSize, setup.

Connects To