NodeType
Provides a standardized, type-safe collection of constants for GLSL data types (e.g., vec3, float) used for declaring variables and functions in TSL.
Core Advantages
By replacing error-prone 'magic strings' (e.g., 'vec3') with type-safe constants (e.g., `NodeType.VECTOR3`), it fundamentally prevents typos, enhances code readability, and ensures the consistency and stability of the entire TSL type system.
Common Uses
Explicitly specifying the type when creating Uniforms (uniform)
Defining the data type for custom vertex attributes (attribute)
Defining parameter and return types for reusable functions (func)
Specifying the target type for type conversions (cast)
How to adjust
This node itself is a constant and cannot be adjusted. However, choosing a different NodeType to 'interpret' the same data can produce drastically different visual effects. For example, interpreting a color vector (Vector4) representing orange as a `NodeType.FLOAT` might only use its first component, causing the model to appear gray, which reveals the critical role of data types in shaders.
Code Examples
1const windFactor = attribute( 'windFactor', NodeType.FLOAT );