Creates count instances, all starting at initial (default all 0).
ReadonlyarrayThe states, 4 floats per instance (wetness, snow, burn, damage).
ReadonlyattributeThe GPU attribute (item size 4).
ReadonlycountNumber of instances.
Adds amount to one state of instance i (clamped to 0…1).
Adds the attribute to a geometry under name (for InstancedBufferGeometry setups).
Relaxes states towards 0 at rates per second (e.g. drying: { wetness: 1 / 7200 }).
The four states as TSL nodes for the current instance. Works with InstancedMesh and instanced geometry.
Copies states from a StateField at each instance position (frame coordinates, x and z read
from positions with stride), so trees pick up fire scars, storm damage, wetness and snow.
Sets states of instance i (clamped to 0…1); missing channels are kept.
Per-instance material states for instanced meshes (trees, rocks, buildings, props): four floats per instance (wetness, snow, burn, damage) in an
InstancedBufferAttribute, read in the shader through InstanceStates.node.Example