Capítulo 431 de 859

Chapter 431: MaterialNode

Core Idea

This class should simplify the node access to material properties. It internal uses reference nodes to make sure changes to material properties are automatically reflected to predefined TSL objects like e.g. materialColor.

Key Concepts

  • scope : string: The scope defines what material property is referred by the node.

Reference Tables

Constructor

Signature
new MaterialNode( scope : string )

Properties

PropertyDescription
.scope : stringThe scope defines what material property is referred by the node.

Methods

MethodDescription
.getCache( property : string, type : string ) : MaterialReferenceNodeReturns a cached reference node for the given property and type.
.getColor( property : string ) : MaterialReferenceNode.<color>Returns a color-typed material reference node for the given property name.
.getFloat( property : string ) : MaterialReferenceNode.<float>Returns a float-typed material reference node for the given property name.
.getTexture( property : string ) : MaterialReferenceNodeReturns a texture-typed material reference node for the given property name.
.setup( builder : NodeBuilder ) : NodeThe node setup is done depending on the selected scope. Multiple material properties might be grouped into a single node composition if they logically belong together.

Key Takeaways

  1. MaterialNode extends: EventDispatcher → Node
  2. Most relevant properties: scope.
  3. Key methods: getCache, getColor, getFloat, getTexture.

Connects To