Procedural noise, fBm, and fractal fields
Learning objectives
- learner can implement fBm by summing noise octaves with decaying amplitude and rising frequency
- learner can reason about the Hurst exponent, noise-color spectra, and spectral efficiency versus sine synthesis
- learner can build multi-scale fractal detail by tiling space with fract() in an iterative loop
Capstone — one whole task that evidences the objectives
Create a procedural terrain/cloud texture driven by fBm and Perlin noise, exposing the Hurst exponent as a control and layering fract-space fractal iteration for multi-scale detail.
Prerequisite modules
This module builds toward the workhorse texture of live-coded visuals: an organic terrain-or-cloud field that never repeats, runs entirely on the GPU, and responds to a single expressive knob. In a VJ set or shader jam, fBm is what turns flat gradients into weather — and exposing the Hurst exponent live means you can morph rolling hills into jagged static in one parameter sweep, on beat, without touching the rest of the patch.
The arc starts supported. You already animate sine patterns from the prereq module; the bridge atom on layered sine octaves shows the 2:1 frequency/amplitude stacking idea in familiar territory. From there, swap sines for noise: “fBm in shaders is built by summing noise octaves” is your JIT how-to for the core loop, while “Perlin noise is a repeatable pseudo-random function of 3D position” supplies the smooth randomness the loop consumes. A first guided exercise hardcodes gain 0.5; the second replaces it with G = 2^(-H) once the fBm definition and self-similarity atoms explain what H actually controls. Finally, “a for loop that repeatedly scales, tiles (fract), and accumulates” layers fract-space repetition on top for detail below the noise floor — the unsupported capstone combines all three moves.
The required set gates the capstone directly: you cannot expose H as a meaningful control without the Hurst and self-similarity concepts, cannot reason about your slider’s endpoints without the noise-color taxonomy, cannot justify noise over an inverse FFT without the spectral-efficiency argument, and cannot layer multi-scale detail without fract tiling and the iteration pattern. The lone supporting atom enriches by connecting this machinery back to sine-based intuition — useful context, but the texture ships without it.
Runnable examples
Generated from the context/ instrument corpus by concept (redistributable idioms only). Do not edit — regenerate with gen-module-examples.mjs.
noise-field
noise(4, 0.1).out()
hydra-0002 · CC0-1.0
float h21(vec2 p){return fract(sin(dot(p,vec2(12.9898,78.233)))*43758.5453);}
glsl-0013 · public-domain
Atoms in this module
Required — these gate the capstone
Supporting — enrichment, not gating
Part of curricula
- Shader Artist — real-time GPU craft to a demoscene-grade visual — Procedural fields and the color look required