Capítulo 474 de 859

Chapter 474: SharpenNode

Core Idea

Post processing node for contrast-adaptive sharpening (RCAS).

Reference: https://gpuopen.com/fidelityfx-superresolution/.

Key Concepts

  • denoise : Node.<bool>: Whether to attenuate sharpening in noisy areas.
  • isSharpenNode : boolean (readonly): This flag can be used for type testing.
  • sharpness : Node.<float>: Sharpening strength. 0 = maximum, 2 = none.
  • 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 { sharpen } from 'three/addons/tsl/display/SharpenNode.js';
  • What it demonstrates: Typical usage of SharpenNode.

Reference Tables

Constructor

Signature
new SharpenNode( textureNode : TextureNode, sharpness : Node.<float>, denoise : Node.<bool> )

Properties

PropertyDescription
.denoise : Node.<bool>Whether to attenuate sharpening in noisy areas.
.isSharpenNode : boolean (readonly)This flag can be used for type testing.
.sharpness : Node.<float>Sharpening strength. 0 = maximum, 2 = none.
.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 output 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. SharpenNode extends: EventDispatcher → Node → TempNode
  2. Most relevant properties: denoise, isSharpenNode, sharpness, textureNode.
  3. Key methods: dispose, getTextureNode, setSize, setup.

Connects To