CV<AdrianYip>::SelectedWork::get<GANTerrainGen>()
::desc<"GAN Procedural Terrain">
::stack<Python, PyTorch, C++, OpenGL>;


GANTerrainGen::overview();

A procedural terrain generator I built in Python and PyTorch. A DCGAN trains on real satellite data (Copernicus 30m elevation and ESA WorldCover 10m land cover) to generate 256×256 terrain maps. I benchmark it against a Perlin-noise fBm baseline I wrote from scratch, scoring how close the generated elevation distribution gets to real terrain.

To see what the model was actually producing, I built a real-time C++/OpenGL viewer that renders any training checkpoint as 3D terrain, displacing a flat mesh in the vertex shader from the height map. An ImGui menu flips between real, baseline, and generated maps live, which made the problem obvious: early terrain came out far too spiky to walk on.

I added two penalties to the generator's training: a smoothness term (total variation plus curvature on the elevation) and a slope limit that only punishes elevation differences too steep to cross, keeping the terrain walkable. Walkability is the goal because eventually I want to drop RL agents onto these maps and have them generalize movements around terrain.



Real

Real terrain overhead Real terrain side

Baseline

Baseline terrain overhead Baseline terrain side

Generated

GAN generated terrain overhead GAN generated terrain side

Saved

Saved terrain overhead Saved terrain side