hash
A high-quality, deterministic pseudo-random number generator that converts an input 'seed' (like coordinates or an index) into a predictable random value, acting as a cornerstone for procedural effects.
Core Advantages
Encapsulates a complex PCG hash algorithm into a simple node, enabling developers to easily get high-quality, high-performance, and predictable random numbers without manually writing and maintaining cross-platform random functions.
Common Uses
Generating procedural textures (e.g., noise, clouds)
Randomizing properties of numerous instances (e.g., color, size)
Creating dynamic flickering or flowing effects with time
Implementing dithering to smooth color gradients
How to adjust
The effect is entirely determined by its input 'seed' node. Adjust by performing math on the seed: multiply by a factor (`seed.mul(10)`) to change the pattern density; add time (`seed.add(timer())`) to create animation; or switch the seed to `instanceIndex` to assign different properties to each instanced object.
Code Examples
1// Combine with time to animate a static noise pattern
2const animatedNoise = hash( uv().add( timerGlobal() ) );