A procedural terrain generator using Fractal Brownian Motion (fBm).
1. Noise
We use Value/Simplex Noise to generate smooth, natural-looking randomness. Unlike simple
Math.random(), which is just static, noise allows nearby points to have similar values.
2. Fractals
To create mountains, we layer multiple "Octaves" of noise on top of each other:
This mimics nature: large shapes (continents) have medium details (ranges) which have small details (rocks).
3. Biomes
We generate two noise maps: one for Elevation and one for Moisture. By
combining them, we decide if a pixel is a Desert (Hot+Dry), Rainforest (Hot+Wet), or Tundra (Cold+Dry).