Capítulo 401 de 859

Chapter 401: ConvertNode

Core Idea

This module is part of the TSL core and usually not used in app level code. It represents a convert operation during the shader generation process meaning it converts the data type of a node to a target data type.

Key Concepts

  • convertTo : string: The target node type. Multiple types can be defined by separating them with a | sign.
  • node : Node: The node which type should be converted.

Reference Tables

Constructor

Signature
new ConvertNode( node : Node, convertTo : string )

Properties

PropertyDescription
.convertTo : stringThe target node type. Multiple types can be defined by separating them with a | sign.
.node : NodeThe node which type should be converted.

Methods

MethodDescription
.generateNodeType( builder : NodeBuilder ) : stringThis method is overwritten since the implementation tries to infer the best matching type from the ConvertNode#convertTo property.

Key Takeaways

  1. ConvertNode extends: EventDispatcher → Node
  2. Most relevant properties: convertTo, node.
  3. Key methods: generateNodeType.

Connects To