Capítulo 456 de 859

Chapter 456: PropertyNode

Core Idea

This class represents a shader property. It can be used to explicitly define a property and assign a value to it.

PropertyNode is used by the engine to predefined common material properties for TSL code.

Key Concepts

  • global : boolean: This flag is used for global cache.
  • isPropertyNode : boolean (readonly): This flag can be used for type testing.
  • name : string: The name of the property in the shader. If no name is defined, the node system auto-generates one.
  • placeholderNode : Node: The placeholder node of the property if it is not assigned.
  • varying : boolean: Whether this property is a varying or not.

Code Examples

const threshold = property( 'float', 'threshold' ).assign( THRESHOLD );
  • What it demonstrates: Typical usage of PropertyNode.

Reference Tables

Constructor

Signature
new PropertyNode( nodeType : string, name : string, varying : boolean, placeholderNode : Node )

Properties

PropertyDescription
.global : booleanThis flag is used for global cache.
.isPropertyNode : boolean (readonly)This flag can be used for type testing.
.name : stringThe name of the property in the shader. If no name is defined, the node system auto-generates one.
.placeholderNode : NodeThe placeholder node of the property if it is not assigned.
.varying : booleanWhether this property is a varying or not.

Key Takeaways

  1. PropertyNode extends: EventDispatcher → Node
  2. Most relevant properties: global, isPropertyNode, name, placeholderNode.

Connects To