---
id: "voronoi-island-map-generation"
title: "Polygon Map Generation (Voronoi Islands)"
aliases: [mapgen2, Voronoi island generation]
domain: "procgen"
stage: "procedural"
realtime: "interactive"
platforms: [cpu, webgl2]
year_introduced: 2010
inputs: [point-cloud]
outputs: [graph, heightfield, layout]
style: "stylized"
dynamic: "static"
cost: "cheap"
authority: "Patel"
url: "https://texelatlas.vercel.app/t/voronoi-island-map-generation/"
sources_verified_at: "2026-11-29"
---
# Polygon Map Generation (Voronoi Islands) (Patel)

> Build fantasy-style island maps on a relaxed Voronoi graph: noise or radial shape sets land versus water, elevation grows from the coast, rivers follow downhill edges and moisture picks biomes.

## Reach for it when

- generate fantasy world maps with islands
- need game map with biomes and rivers
- polygon based terrain for strategy games
- noise maps look unnatural for coastlines

## How it works

Place seed points (Poisson or relaxed random), compute the Voronoi/Delaunay graph, and treat each polygon as a map cell. A shape function (radial or noise-based) marks cells as land or water; ocean is flood-filled from the border so lakes remain distinct. Elevation increases with distance from the coast, rivers are traced down steepest edges and accumulate flow, moisture comes from distance to rivers and lakes, and a biome table maps elevation and moisture to colour. The graph is explicit, so cells carry data for gameplay, and the result can be turned into a heightmap or mesh.

## When to use it

Choose it for game worlds, board-game maps and stylised overworld terrain where graph data (provinces, rivers) matters. Prefer [Fractal Brownian Motion and Multifractals](https://texelatlas.vercel.app/t/fractal-brownian-motion.md) or [Stream-Power Erosion (Fluvial Terrain Uplift)](https://texelatlas.vercel.app/t/stream-power-erosion.md) for realistic heightfields, [Terrain from Hydrology (River-First Terrain Synthesis)](https://texelatlas.vercel.app/t/hydrology-terrain-synthesis.md) when river structure should shape terrain, and [Procedural City Generation (L-system Road Networks)](https://texelatlas.vercel.app/t/procedural-city-roads.md) to lay out settlements.

## Cost

cheap — Graph construction and a few linear passes; seconds even for large cell counts.
Measured GPU Weight: 18.39× baseline (moderate) — 0.6051 ms median / 0.6312 ms p95 on Tesla T4/PCIe/SSE2 @ 1920x1080 (opengl-timer-query).
Ada L4 scaling: 18.39× baseline (moderate) — 0.2924 ms median (2.07× faster on L4).
Ampere A100 scaling: 12.33× baseline (moderate) — 0.3552 ms median (1.7× faster on A100).

## Failure modes

- Voronoi cell edges leave visibly polygonal coastlines unless smoothed or noise-perturbed
- River courses are constrained to cell edges, producing zigzag rivers
- Elevation from distance-to-coast gives uniform island-like shapes with little variety
- Biome tables overfit to Earth-like climates, giving odd maps on non-island layouts

## Dataflow

- Inputs: point-cloud
- Outputs: graph, heightfield, layout
- Platforms: cpu, webgl2

## Presets

### Voronoi polygon island map with elevation-based biomes (glsl-fragment; rendered 2026-11-29)

```json
{
  "CELLS": 12,
  "SEA_LEVEL": 0.32
}
```

```glsl
// Polygon island map: Voronoi cells from jittered sites get elevation (noise minus radial falloff) and biome by height.
const float CELLS = 12.0;
const float SEA_LEVEL = 0.32;
vec2 hash2(vec2 p) { return fract(sin(vec2(dot(p, vec2(127.1, 311.7)), dot(p, vec2(269.5, 183.3)))) * 43758.5453); }
float vnoise(vec2 p) {
    vec2 i = floor(p), f = fract(p), u = f * f * (3.0 - 2.0 * f);
    float a = hash2(i).x, b = hash2(i + vec2(1, 0)).x, c = hash2(i + vec2(0, 1)).x, d = hash2(i + 1.0).x;
    return mix(mix(a, b, u.x), mix(c, d, u.x), u.y);
}
float elev(vec2 s) {
    float n = 0.55 * vnoise(s * 4.0) + 0.3 * vnoise(s * 9.0 + 3.0) + 0.15 * vnoise(s * 19.0 + 9.0);
    float r = length(s - 0.5) * 2.0;
    return n * 1.1 - r * r * 0.8 + 0.18;
}
void mainImage(out vec4 fragColor, in vec2 fragCoord) {
    vec2 uv = fragCoord / iResolution.xy;
    vec2 p = uv * CELLS, ip = floor(p);
    float d1 = 1e9, d2 = 1e9; vec2 best = vec2(0), second = vec2(0);
    for (int j = -2; j <= 2; j++) for (int i = -2; i <= 2; i++) {
        vec2 c = ip + vec2(i, j);
        vec2 s = c + 0.15 + 0.7 * hash2(c);
        float d = distance(p, s);
        if (d < d1) { d2 = d1; second = best; d1 = d; best = s; } else if (d < d2) { d2 = d; second = s; }
    }
    float e = elev(best / CELLS);
    vec3 col;
    if (e < SEA_LEVEL) col = mix(vec3(0.05, 0.12, 0.3), vec3(0.15, 0.35, 0.55), smoothstep(-0.3, SEA_LEVEL, e));
    else if (e < SEA_LEVEL + 0.04) col = vec3(0.85, 0.78, 0.55);
    else if (e < 0.55) col = mix(vec3(0.3, 0.55, 0.25), vec3(0.15, 0.4, 0.2), (e - SEA_LEVEL) / 0.25);
    else if (e < 0.7) col = mix(vec3(0.45, 0.4, 0.33), vec3(0.6, 0.57, 0.52), (e - 0.55) / 0.15);
    else col = vec3(0.95);
    float edge = (d2 - d1);
    col *= 0.78 + 0.22 * smoothstep(0.0, 0.14, edge);
    float es = elev(second / CELLS);
    if ((e >= SEA_LEVEL) != (es >= SEA_LEVEL)) col = mix(col, vec3(0.1, 0.08, 0.05), smoothstep(0.1, 0.0, edge) * 0.8);
    fragColor = vec4(pow(col, vec3(0.8)), 1.0);
}

```

Attribution: written for this index

## Lineage

- extends [Voronoi Diagrams and Lloyd Relaxation](https://texelatlas.vercel.app/t/voronoi-lloyd-relaxation.md)

## Sources

1. [primary] Amit Patel Mapgen2 Procedural Island Map Generator. redblobgames.com. https://www.redblobgames.com/maps/mapgen2 (verified via http on 2026-11-29)
2. [implementation] redblobgames (2017) redblobgames/mapgen2. https://github.com/redblobgames/mapgen2 License: Apache-2.0. (verified via github on 2026-11-29)

## Cite this entry

Texel. "Polygon Map Generation (Voronoi Islands)." https://texelatlas.vercel.app/t/voronoi-island-map-generation/ (accessed 2026-12-01).
