Capítulo 476 de 859

Chapter 476: SobelOperatorNode

Core Idea

Post processing node for detecting edges with a sobel filter. A sobel filter should be applied after tone mapping and output color space conversion.

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 updates its internal uniforms once per frame in updateBefore().

Code Examples

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

Reference Tables

Constructor

Signature
new SobelOperatorNode( 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 updates its internal uniforms once per frame in updateBefore().

Methods

MethodDescription
.setup( builder : NodeBuilder ) : ShaderCallNodeInternalThis method is used to setup the effect's TSL code.
.updateBefore( frame : NodeFrame )This method is used to update the effect's uniforms once per frame.

Key Takeaways

  1. SobelOperatorNode extends: EventDispatcher → Node → TempNode
  2. Most relevant properties: textureNode, updateBeforeType.
  3. Key methods: setup, updateBefore.

Connects To