Six Ways to Draw Vangers with WebGPU: Real-Time Rendering of Editable Multi-Layer Height Fields
Dzmitry Malyshau
cs.GR
2026-08-18
Six renderers, one WebGPU engine, on Vangers' dual-layer 1998 terrain. The greedy TIN mesh is fastest on all five adapters but retains 854 MiB, and fit cost tracks the second layer, not relief.
Terrain level-of-detail research almost always measures on digital elevation models: single-valued, smooth at the sampling scale, sampled from real topography. Authored game terrain breaks all three assumptions. Vangers (1998) shipped hand-authored terrain quantized to bytes, intentionally discontinuous, and multi-layered: a texel pair can encode a floor (low), a cave ceiling (mid), and a slab top (high), with the cave sandwiched between two solid intervals. Fostral, the level used throughout, is 2048×16384 with 10.9% double-level texels.
The study sets three hard constraints. The renderer must preserve both solid intervals, so caves cannot be decoration. It must fit an interactive frame budget. And a bounded edit to height or layer metadata must become visible without a level reload, because terrain destruction in Vangers is a gameplay operation, not an authoring-time exception. The 1998 engine did all of this in software inside a 16 MB budget, at the price of a mildly oblique top-down camera. Modern GPUs make arbitrary cameras practical, and eye-level horizons expose any representation not matched to the data.
All six methods run in one engine (native wgpu/WebGPU, a single validated WGSL source), over one data path and one fragment shading stage, so differences are attributable to the method itself. Quality is scored against a CPU ray cast of the same source data, counting bidirectional see-through and local coherence error.
Mean frame time over 12 scenes at the selected quality (ms; the M3 row is CPU submit-and-wait):
| Method | 780M | 7900 XT | RTX 5070 | M3 | Intel RPL-U |
| Ray 128 | 4.83 | 0.65 | 0.79 | 8.34 | 18.17 |
| Voxel | 8.32 | 1.40 | 1.26 | 12.49 | 35.57 |
| Sliced | 9.34 | 1.63 | 1.90 | 12.13 | 41.69 |
| Scattered | 9.22 | 2.79 | 1.47 | 18.45 | 88.20 |
| Painted | 15.84 | 5.22 | 4.69 | 32.72 | 79.63 |
| Mesh q0.5 | 4.07 | 0.39 | 0.50 | 5.92 | 11.45 |
The mesh has the lowest mean on every adapter. Pitch separates the rest (pitch 0°, see-through/coherence %): Scattered leaves 40.4% of reference terrain uncovered, 19.1–73.2% across its three scenes, while every other method stays between 0.0% and 0.9%. Sliced covers well but shows 2.7% coherence bands at grazing angles. The selected mesh stays in the coherent group; at the hangar view q=0.0 misses 11.0%, while q=0.5 leaves 0.5% and keeps the wall.
The mesh's bill lands elsewhere. Editability retains 318.7 MiB of GPU geometry plus 534.7 MiB of CPU triangulation (three LODs and every chunk's live triangulation), against 0/0 for RayTraced and 18.29 MiB for RayVoxel. After digging a radius-48 crater, its first updated frame costs +9.88 ms of CPU (GPU only +1.30 ms), and at 16 frames it still differs from a fresh build by 0.0016% hit/miss classification; the five other methods match a fresh edited build on the first frame on every adapter.
The fit-cost attribution is the sharpest result. Single-layer worlds compress 45–182×, yet log reduction correlates at only −0.17 with floor roughness and −0.77 with the double-level texel fraction. hmok has a smoother floor than threall (2.71 vs 2.85) but compresses 5.2× against 45.3×, because 47% of its triangles sit on slab surfaces. On Fostral at q=0.25, 23.3% of insertions serve the single/double-level boundary alone, and that cost is nearly flat in quality (338k at q=0, 396k at q=1) while the floor's share grows from 444k to 6.1M. An error-driven fit over a field with embedded discontinuities burns its budget chasing a fault no tolerance can satisfy.
For engine and WebGPU developers this is a reproducible comparison: the engine, the harness, and a one-command measurement protocol are released, across five devices spanning Vulkan and Metal backends. The methodological warning is larger. A timing table alone would pick the mesh, and a timing table does not bill memory, edit maintenance, or view-dependent quality budgets. Treating the first post-edit frame as a first-class result applies to any project with runtime terrain modification, and the finding that the second layer, not relief, sets fit cost extends to any error-driven simplification over discontinuous fields. The methods themselves are not new; all six lineages have precedents, and the contribution is the controlled comparison plus the failure analysis, a measurement-methodology increment rather than a breakthrough.
Author-stated bounds: one terrain format, with the mechanism argued rather than measured beyond Vangers data; rendering comparisons use Fostral only (CC BY-SA; the other nine worlds require a lawfully obtained copy); four Vulkan devices plus one Metal, with no D3D12, WebGL2, or mobile adapters; frame timing is per-frame latency, not pipelined throughput; tuning uses one fixed three-scene fixture; the edit experiment covers one crater shape and location; chunk streaming is not implemented. The paper also discloses LLM assistance from OpenAI Codex, Anthropic Claude, and xAI Grok in drafting, editing, and harness work, with the author claiming review of every claim, number, and citation. A single independent author limits cross-checking density, though the cross-device verification and the released harness are solid for the genre.