File: RangeNode.md | Updated: 11/15/2025
RangeNode generates random instanced attribute data in a defined range. An exemplary use case for this utility node is to generate random per-instance colors:
const material = new MeshBasicNodeMaterial();
material.colorNode = range( new Color( 0x000000 ), new Color( 0xFFFFFF ) );
const mesh = new InstancedMesh( geometry, material, count );
Constructs a new range node.
minNode | A node defining the lower bound of the range. Default is float().
---|---
maxNode | A node defining the upper bound of the range. Default is float().
A node defining the upper bound of the range.
Default is float().
A node defining the lower bound of the range.
Default is float().
Returns a constant node from the given node by traversing it.
node | The node to traverse.
---|---
Returns: The constant node, if found.
This method is overwritten since the node type is inferred from range definition.
builder | The current node builder.
---|---
Overrides: Node#getNodeType
Returns: The node type.
Returns the vector length which is computed based on the range definition.
builder | The current node builder.
---|---
Returns: The vector length.