Random
Hash-based spatially incoherent random field generator. Every sample point gets an independent random value — TV static, not smooth clouds.
Category: Fields Menu path: Fields > Random
Ports
| Port | Type | Direction | Description |
|---|---|---|---|
out | imageRgba16f | output | GPU rasterized random texture (grayscale) |
scalar | scalar | output | Single random value (hash at origin) |
vec2 | vec2 | output | Two decorrelated random values |
scalarField | scalarField | output | Per-sample random field [0, 1] |
vectorField | vectorField | output | Per-sample decorrelated 2D random field |
Parameters
| Param | Type | Default | Description |
|---|---|---|---|
seed | scalar | 0 | Random seed. Different seeds produce completely different patterns. |
scale | vec2 (linked) | 100, 100 | Block size in pixels. Scale=1 gives per-pixel randomness. Scale=100 gives 100x100 pixel blocks of uniform random color. |
evolution | scalar | 0 | Temporal variation. Any change produces a new random pattern. Animate for flickering/changing randomness. |
Expose Channels
When enabled (E button on node header), adds input ports that override params via edge connections:
| Port | Type | Overrides |
|---|---|---|
seed_in | scalar | seed |
scale_in | vec2 | scale |
evolution_in | scalar | evolution |
How It Works
Uses a PCG (Permuted Congruential Generator) hash function to produce pseudo-random values from quantized spatial coordinates. The input position is divided by scale and floored to integer cell coordinates, then combined with seed and evolution bits and hashed. This produces spatially incoherent output — neighboring pixels/cells have no correlation, unlike Noise which produces smooth, coherent patterns.
The texture output rasterizes the field as grayscale (each cell gets a uniform random luminance). The scalar/vec2 outputs evaluate the hash at the origin. The field outputs are the primary creative outputs — they evaluate the hash at each consumer's sample point.
Usage Examples
Basic: Per-element randomization (static elements)
Connect scalarField to PointAttributes or ShapeAttributes to give each point/vertex a random scale, rotation, opacity, or color value. This is sampled by position — right for a Grid or a scattered shape that stays put. For elements that move (particles, advected points, cloned shapes on a moving stream) see the per-element tip below.
Basic: Animated static
Keyframe evolution from 0 to 30 over 30 frames. Each frame gets a completely new random pattern — classic TV static effect.
Creative: Random mosaic
Set scale to a large value (e.g. 50x50). Connect scalarField to Colorize with a gradient ramp to create a random colored tile/mosaic pattern.
Creative: Jittered motion
Connect vectorField to PointAdvect for Brownian-motion-like jitter. Each point gets an independent random displacement per frame (when evolution is animated).
Tips
- Scale controls the "grain size" — small scale = fine static, large scale = blocky patches
- Evolution is continuous — even tiny changes produce entirely different patterns
- For smooth, organic randomness, use Noise instead. Random is for when you want true independence between samples.
- Pipe through Remap to reshape the distribution (e.g. bias toward high or low values)
- Pipe through Colorize to map random luminance to a color palette
- Random per element, not per position. A field is sampled where the element is, so a particle or advected point re-rolls its value every time it crosses into a new cell — visible as flicker. For "one random value per element, fixed for its whole life" use PointAttributes / ShapeAttributes with
source: Random(a hash of the element's stable id and a seed), or the@rand01intrinsic in an Apply To rule (e.g.@rand01 > 0.5on Point Delete keeps a random half of the stream). Both stay put as the element moves and survive neighbours being deleted.
Related Nodes
- Noise — spatially coherent alternative (smooth patterns, fBm, looping)
- Remap — reshape random distribution via curve
- Colorize — map random scalar values to color ramp
- PointAttributes — apply a random field per point, or
source: Randomfor a fixed per-element value - ShapeAttributes — apply a random field per vertex, or
source: Randomfor a fixed per-path value - PointSolver — particles: the case where per-element randomness matters most