Capítulo 507 de 859
Class for representing shader variables as nodes. Variables are created from existing nodes like the following:
VarNode sets this property to true by default.const depth = sampleDepth( uvNode ).toVar( 'depth' );
Constructor
| Signature |
|---|
new VarNode( node : Node, name : string, readOnly : boolean ) |
Properties
| Property | Description |
|---|---|
.global : boolean | VarNode sets this property to true by default. |
.intent : boolean | This flag is used to indicate that this node is used for intent. |
.isVarNode : boolean (readonly) | This flag can be used for type testing. |
.name : string | The name of the variable in the shader. If no name is defined, the node system auto-generates one. |
.node : Node | The node for which a variable should be created. |
.parents : boolean | Add this flag to the node system to indicate that this node require parents. |
.readOnly : boolean | The read-only flag. |
Methods
| Method | Description |
|---|---|
.getIntent() : boolean | Returns the intent flag of this node. |
.isIntent( builder : NodeBuilder ) : boolean | Checks if this node is used for intent. |
.setIntent( value : boolean ) : VarNode | Sets the intent flag for this node. |