Ridge Noise

9 / 15
Learn procedural noise building blocks and common stylizations.

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:

  1. n * 2.0 - 1.0 — remaps [0, 1] to [-1, 1]
  2. 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

ChangeEffect
6.03.0Fewer, wider ridges
6.012.0Dense network of fine lines
Remove 1.0 -Becomes turbulence noise — ridges and valleys swap
mix(dark, bright, n) around the resultRidge 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 bottom
  • 1.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.

GLSL Code Editor

Correct Code Preview

Current Code Preview