TechniquesNewGPU occlusion culling: a depth pyramid, two phases
Skips the instances something nearer hides, on the GPU, in the same frame.

The HaTac engine’s structure path (shape-build, shape-bake and structure-draw at e27d0ed), lifted whole and engine-free.
A structure is a recipe of parts with bevels (boxes, cylinders, extrusions, sweeps, lofts, stairs, ladders, railings, panels with holes), repeats, mirrors, details, motions and leafwork roles; the builder turns it into four levels of detail on the CPU, with edge, hollow and curvature data per vertex, joints where slender parts meet, and faces that would z-fight moved clear. The bake draws each level from 40 to 64 directions on the GPU and gathers ambient occlusion and cavity per vertex. The drawer holds every kind in one vertex and one index buffer; one compute pass culls every copy against the view and two shadow cascades, picks a continuous, rate-limited level and its dithered cross-fade, and fills indirect arguments, so a valley of copies is a handful of draws. Machines move in the vertex shader from one clock and each copy’s drive (spins, keyed sequences, slider-cranks, gears, bones), easing to a stop on their rest pose. Weather lies on them from a weather surface: settled snow in clumps from rest-space noise that grow and join, leafwork tiers holding their own, a roof keeping its pack off what stands under it, and, new in the library, wet wood and steel after rain. A standalone host written for the library gives a raw WebGPU page the frame, camera, cascades, HDR targets, sky and present the engine’s core gave. The demo forges a hamlet in a valley while you watch: cabins, sheds, a canopy over working machines, a water tower, wind pumps, a lookout, lamps, a kiln and spruce groves, about 760 copies of 17 kinds, in snow, after rain, at dusk or at night.
Measured 28 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 4.71–4.85, CPU 0.54–0.55 ms). What ran: Alone: the bare drawer: 17 kinds forged on the page (4 levels each, occlusion baked), 14 copies of each in rows running away from the eye (238 instances), one GPU cull and level pick for the camera and two shadow cascades, the indirect draws, contact shadows and glow points, with the weather surface’s deep snow, on a plain floor, in the morning; machines at work. 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("structure-forge")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 shape builder, occlusion bake, structure drawer, motion language, settled snow, their tests and the machine examples (built for his game and proven there); the library’s host, weather surface, demo, recipes and valley.
Krzysztof Narkowicz, ACES filmic tone mapping curve (2016): The fitted curve the host presents with.
Brian Karis, Real shading in Unreal Engine 4 (SIGGRAPH 2013): The GGX distribution, Schlick–Smith visibility, Fresnel and the analytic environment BRDF in the drawer’s light.