TechniquesNewStructure forge: recipes into four levels, baked occlusion, drawn and culled on the GPU (engine-free WebGPU)
The HaTac engine’s structure path (shape-build, shape-bake and structure-draw at e27d0ed), lifted whole and engine-free.

The HaTac engine’s terrain kit, lifted out whole in raw WebGPU.
Landforms (basins, valleys, plateaus, lakes, vistas) are rasterised on the GPU into erosion’s inputs, a hydraulic and thermal erosion bake runs once on the GPU and is read back into CPU fields (height, soil, wetness, slope, exposed rock, flow), and those fields are the authority: a deterministic brush raises, lowers, flattens, smooths, levels pads, grades ramps and cuts channels on them, bit for bit the same on every machine, each gesture an entry on a journal that replays exactly and whose edited tiles are checkpoint columns. The same fields, cut into GPU tiles, are drawn as nested clipmap rings with toroidal caches, morphed so rings never seam or pop, whose near grid is one vertex a sample on every tier, with their own cascaded shadow pass; a coarse backdrop seamed round the editable ground carries the rings to the horizon, and the exact drawn height (ring, triangle and morph) stands anything placed on the ground. The demo is a steep valley with banded rock walls, gullies, conifers, boulders and a tarn under a hazy afternoon sky, which the viewer digs, raises and levels, then weathers again with the rain.
Measured 25 November 2026 on RTX 4060 Laptop, 13th Gen Intel(R) Core(TM) i9-13900H, Chrome 158, 1920×1080 at 1×. 600 frames × 3 rounds, median kept (rounds ranged GPU 5.89–6.01, CPU 0.24–0.26 ms). What ran: Alone: the bare terrain as two clipmaps (the 768 m valley at 1.5 m a sample and 16 km of ranges at 16 m) with their rings tinted, three 2048² shadow cascades drawn from the terrain itself, the sky host’s sky and haze, at 1920×1080; the camera circles slowly, so rings move and toroidal strips refill every few frames. Phones: tiers are being measured next.
Frames run on a 60 Hz timer (a page demo), so most frames take about one tick, 16.7 ms: the spread around it is what matters.
install("terrain-world")Your coding agent reads its pitfalls and installs it through the library’s MCP server. Set it upFrom HaTac. Adapted from published work, named below.
Hannes Andersson: The HaTac engine’s terrain kit (built for his game and proven there), the library host and the demo’s valley.
Xing Mei, Philippe Decaudin & Bao-Gang Hu, Fast Hydraulic Erosion Simulation and Visualization on GPU (2007): The pipe model the erosion bake follows (outflow, transport, erosion and deposition); the engine’s README links it. Re-written, no code taken.
Arul Asirvatham & Hugues Hoppe, Terrain Rendering Using GPU-Based Geometry Clipmaps (GPU Gems 2, 2005): Nested rings round the eye, toroidal updates and the transition morph; the engine’s terrain design cites it.
Ken Perlin, Improving Noise (2002): The quintic fade of the gradient noise.
Steven Worley, A Cellular Texture Basis Function (1996): The cellular noise.