home/ atoms/ layered-sine-octaves

Adding a second sine octave at double frequency and half amplitude adds fine detail to procedural patterns

A single sine wave produces a smooth, regular pattern. Adding harmonics with 2× frequency and 0.5× amplitude introduces finer-scale variation that breaks regularity without changing the overall structure. This frequency-doubling / amplitude-halving ratio (2:1) reflects the natural fractal relationship seen in mountain profiles, cloud boundaries, and rough surfaces. In shader clouds, the first octave defines the broad shape; the second breaks the silhouette into irregular lumps. This is the foundation of fractional Brownian motion (fBm) but with sine instead of Perlin noise.

Examples

float cloud = sin(uv.x*2.0+sin(uv.y*3.0)); cloud += 0.5*sin(uv.x*4.0+sin(uv.y*6.0));

Assessment

Describe the visual change when you add a third octave (4× frequency, 0.25× amplitude) to a two-octave cloud pattern.

“multiplying all the frequencies by two, so, and yes, because I like my code to be super well aligned, you know, if I have 2.0 here, these two part of the code on the line visually”
corpus · inigo-quilez-live-coding-happy-jumping-video · chunk 22