User Rating 0.0
Total Usage 0 times
Drag to rotate • Scroll to zoom
Is this tool helpful?

Your feedback helps us improve.

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 2H 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.

brownian surface diamond-square algorithm terrain generator heightmap fractal surface procedural generation 3d terrain

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 δk

Square 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 2H k

Where 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 TypeHurst Exponent HCharacterReal-World Analog
Jagged Peaks0.10 - 0.25Extremely rough, sharp spikesKarst limestone, coral reef
Rocky Mountains0.25 - 0.40High frequency, steep gradientsAlpine peaks, volcanic ridges
Eroded Hills0.40 - 0.55Moderate roughness, natural lookAppalachian hills, weathered cliffs
Rolling Plains0.55 - 0.70Gentle undulationsGreat Plains, Scottish Highlands
Smooth Dunes0.70 - 0.85Low frequency, broad featuresSaharan dunes, glacial moraines
Near-Flat Plateau0.85 - 1.00Very smooth, minimal variationSalt flats, frozen lakes
Cloud Density0.60 - 0.75Soft, billowy gradientsCumulus cloud fields
Ocean Floor0.45 - 0.65Mid-ocean ridges + abyssal plainsAtlantic seabed
Martian Terrain0.50 - 0.60Cratered, moderately roughMars Valles Marineris
Lunar Surface0.30 - 0.50Impact craters, regolithMoon highland terrain
Glacier Surface0.65 - 0.80Crevassed but broadly smoothAntarctic ice sheet
Fracture Network0.15 - 0.30High contrast, crack-likeDried mud, tectonic faults
Procedural Game Map0.50 - 0.65Balanced realismOpen-world RPG terrain
Material Roughness0.20 - 0.45Micro-scale surface texturePBR roughness maps
White Noise (Limit)0.00Uncorrelated, maximum entropyStatic / random noise

Frequently Asked Questions

The fractal dimension of a Brownian surface is D = 3 H. A Hurst exponent of 0.5 yields D = 2.5, which is typical for natural mountain terrain. Lower H increases the fractal dimension toward 3.0, producing space-filling roughness.
The Diamond-Square algorithm requires recursive halving of the grid. A side length of 2n + 1 ensures that midpoints always land on integer coordinates at every subdivision level. Common sizes: 65, 129, 257, 513, 1025.
The square step samples along axis-aligned diamonds, introducing directional bias. This is a known limitation. Mitigation strategies include: adding a small amount of post-process Gaussian blur, using wrapping boundary conditions, or switching to spectral synthesis (FFT-based) for artifact-free results. This tool uses edge-aware averaging to reduce but not eliminate this effect.
Yes. Export the grayscale heightmap PNG. In Unity, import it as a RAW or PNG heightmap in the Terrain component (Terrain > Import Heightmap). In Unreal, use the Landscape tool's Import function. Ensure the resolution matches your terrain actor dimensions. The grayscale values map linearly: black = minimum elevation, white = maximum.
The seed initializes a deterministic pseudo-random number generator (Mulberry32). Identical seed, grid size, and roughness will always produce the same surface. Changing the seed by even 1 produces a completely different terrain. Use seeds to catalog surfaces or share configurations with collaborators.
The maximum grid in this tool is 1025 × 1025 (210 + 1), requiring approximately 8.4 MB for a Float64Array. Computation takes 50 - 200 ms on modern hardware. The 3D renderer draws up to ~2 million triangles, which may reduce frame rate on integrated GPUs. For smooth interaction, use 257 or lower for real-time rotation.