Command Palette

Search for a command to run...

Hectal
Back to the lesson: Topic 12.4 — Noise and Shaping Functions
3D Web · Example 1 of 2

Hash, value noise and fBm, in numbers and on screen

Left: hash. Middle: value noise. Right: fBm with 5 octaves. The text lines come from 32 × 32 float pictures.

Noise is random numbers made smooth: hash a grid, blend the corners (value noise), add smaller copies (fBm). Shaping functions bend a number's curve. Together they make clouds, rust, and the paint's metal flake.

Change the code and press Run (Ctrl+Enter). Predict what will happen first, then break it on purpose and read what changes. Your edits are saved and match the lesson page.

Ready for more? This phase has 5 hands-on exercises with automatic checks.

Practice questions

Write the code in the editor, run it, then open the model answer to compare.

01

Make fBm with 3 octaves and a gain of 0.7.

02

Turn the value noise into rust: dark brown where the noise is above 0.6.

Explain it without notes

01

Why is value noise smooth when hash noise is not?

02

Why compute flakes in object space instead of screen or world space?

Hash, value noise and fBm, in numbers and on screen
Press Run to see the page.
idle

Console

Nothing logged yet.

Expected console output

hash noise:      min 0.00 max 0.97 mean 0.61 | biggest step between neighbouring pixels 0.899
value noise:     min 0.02 max 0.99 mean 0.62 | biggest step between neighbouring pixels 0.164
fbm, 1 octave:   min 0.01 max 0.49 mean 0.31
fbm, 5 octaves:  min 0.10 max 0.82 mean 0.57
x = -1.5 -> floor: -2 | int: -1
x = -0.5 -> floor: -1 | int:  0
x =  0.5 -> floor:  0 | int:  0
x =  1.5 -> floor:  1 | int:  1