Skip to main content
Shaders for Games (GLSL) Lesson 15 of 20

fBm — layering noise into detail

Stack octaves of noise for the rich look of clouds, smoke and terrain.

A single layer of noise looks soft and blobby. Real clouds, smoke, marble and mountains have detail at every scale — big shapes with finer and finer texture on top. You get that by adding several layers of noise together: each layer (an "octave") is half the size and half the strength of the one before. Summing them is called fractal Brownian motion, or fBm — the single most useful noise technique in shader art.

The fbm() function below loops five times, each pass doubling the frequency (finer detail) and halving the amplitude (less influence). The result is noise with structure at every scale. Edit it live — try more octaves, or change how fast the frequency and amplitude change.

That is a live, drifting cloudscape — fBm coloured with mix() and nudged by u_time. This is exactly how shader clouds, fog and smoke are built.

Tip Because fBm produces an ever-changing organic texture — not a single "correct" image — this lesson is yours to explore rather than graded. Change the octaves and colours, make a sky you like, then reuse the technique in your own effects.
Quick check

What makes fBm richer than a single layer of noise?

▶ Build a cloudscape Paste the fbm helper, colour it with mix(), and drift it with u_time.
Wayline
Tools, assets and tutorials for game makers
Get started