Brownian Surface Generator
Generate realistic fractional Brownian surfaces using the Diamond-Square algorithm. Export 3D terrain heightmaps as PNG with adjustable roughness and color maps.
About
Fractional Brownian surfaces model natural terrain, cloud density fields, and material roughness. The underlying stochastic process depends on the Hurst exponent H, which controls spatial correlation: values near 1.0 produce smooth, rolling landscapes, while values near 0.0 yield jagged, high-frequency noise. This tool implements the Diamond-Square algorithm on a grid of size (2n + 1)2, applying random midpoint displacement at each recursion level. The displacement magnitude decays by a factor of 2−H per subdivision, directly linking the Hurst parameter to the spectral density falloff.
Incorrect roughness calibration produces unrealistic terrain. A surface intended for hydraulic erosion simulation requires H ≈ 0.7 - 0.8, matching empirical measurements of real mountain ranges. This generator exports both a colorized 3D preview and a raw grayscale heightmap suitable for import into game engines or GIS software. Note: the Diamond-Square algorithm introduces slight directional artifacts along grid axes. For production terrain, consider post-processing with erosion filters.
Formulas
The Diamond-Square algorithm generates a fractal heightmap on a square grid of side length N = 2n + 1. At each recursion level k, two steps alternate:
Diamond step: For each square of side s, the center point receives the average of its four corners plus a random displacement:
hcenter = h1 + h2 + h3 + h44 + R ⋅ δkSquare step: For each diamond, the midpoint of each edge receives the average of its diamond neighbors plus displacement.
The displacement scale decays exponentially:
δk = δ0 ⋅ 2−H ⋅ kWhere R ∈ [−1, 1] is a uniform random variable, δ0 is the initial displacement amplitude, and H is the Hurst exponent (0 < H ≤ 1). Higher H produces smoother surfaces because high-frequency components are suppressed more aggressively. The resulting surface has a spectral density proportional to 1f2H + 2, characteristic of fractional Brownian motion in two dimensions.
Reference Data
| Terrain Type | Hurst Exponent H | Character | Real-World Analog |
|---|---|---|---|
| Jagged Peaks | 0.10 - 0.25 | Extremely rough, sharp spikes | Karst limestone, coral reef |
| Rocky Mountains | 0.25 - 0.40 | High frequency, steep gradients | Alpine peaks, volcanic ridges |
| Eroded Hills | 0.40 - 0.55 | Moderate roughness, natural look | Appalachian hills, weathered cliffs |
| Rolling Plains | 0.55 - 0.70 | Gentle undulations | Great Plains, Scottish Highlands |
| Smooth Dunes | 0.70 - 0.85 | Low frequency, broad features | Saharan dunes, glacial moraines |
| Near-Flat Plateau | 0.85 - 1.00 | Very smooth, minimal variation | Salt flats, frozen lakes |
| Cloud Density | 0.60 - 0.75 | Soft, billowy gradients | Cumulus cloud fields |
| Ocean Floor | 0.45 - 0.65 | Mid-ocean ridges + abyssal plains | Atlantic seabed |
| Martian Terrain | 0.50 - 0.60 | Cratered, moderately rough | Mars Valles Marineris |
| Lunar Surface | 0.30 - 0.50 | Impact craters, regolith | Moon highland terrain |
| Glacier Surface | 0.65 - 0.80 | Crevassed but broadly smooth | Antarctic ice sheet |
| Fracture Network | 0.15 - 0.30 | High contrast, crack-like | Dried mud, tectonic faults |
| Procedural Game Map | 0.50 - 0.65 | Balanced realism | Open-world RPG terrain |
| Material Roughness | 0.20 - 0.45 | Micro-scale surface texture | PBR roughness maps |
| White Noise (Limit) | 0.00 | Uncorrelated, maximum entropy | Static / random noise |