Ridge Noise
Normal FBM produces smooth, rounded hills. Ridge noise inverts that — the tops become sharp peaks and the low areas flatten out:
Let's break down the transform.
What abs(n * 2.0 - 1.0) does
Step by step:
n * 2.0 - 1.0— remaps [0, 1] to [-1, 1]abs(...)— folds negative values back to positive; the middle range (around 50% noise) collapses to the lowest point
Adding the outer 1.0 - ... flips everything:
- Noise near 0% or 100% (the extremes) → becomes 0 (dark valley)
- Noise near 50% (the middle) → becomes 1 (bright peak)
This is the "ridge" effect — sharp bright lines where the noise crosses 50%, with wide dark valleys on either side.
Ridge vs turbulence
Turbulence uses abs(n * 2.0 - 1.0) without inverting: midrange values become the dark valleys and extremes become the bright peaks.
Ridge noise uses 1.0 - abs(n * 2.0 - 1.0): exactly the opposite. Both fold the noise curve; they just flip which end is bright.
Try changing it
| Change | Effect |
|---|---|
6.0 → 3.0 | Fewer, wider ridges |
6.0 → 12.0 | Dense network of fine lines |
Remove 1.0 - | Becomes turbulence noise — ridges and valleys swap |
mix(dark, bright, n) around the result | Ridge lines appear to glow |
Exercise
Inside main, apply n = 1.0 - abs(n * 2.0 - 1.0) to the output of fbm(vUv * 6.0) and display the result.
Answer Breakdown
Add one line after float n = fbm(...): n = 1.0 - abs(n * 2.0 - 1.0).
n * 2.0 - 1.0— stretch [0,1] to [-1,1]abs(...)— fold negatives back, collapsing the midrange to the bottom1.0 - ...— invert so midrange peaks become bright
The starter produces plain fractal noise with rounded shapes. Adding this one-liner reshapes the tone curve so that the peaks sharpen and the broad slopes become flat, creating the ridge pattern.
Try changing 2.0 to 4.0 and see the ridges become sharper and more densely packed.