Skip to main content

Terrain tile skirts

Shared raster-dem terrain appends display-only walls after real surface triangles along valid outer tile edges. Downward skirts hide bounded neighbouring-height or LOD cracks. Existing setTerrain needs no additional script option.

Surface index counts remain fixed. Coordinate picking, project/unproject, raster draping and elevation sampling use only the real surface; skirts never become DEM values or queryable ground. Nodata edge segments produce no wall or implicit flat patch. Grid corners and source pixels stay unchanged.

Depth is the greater of half the displayed height range and grid-cell width, at least 1 and capped at one million Mercator metres. This prevents unbounded walls for extreme global tiles. Separate side normals provide lighting; candidate CPU/GPU budgets include the added vertices and indices. Skirts hide cracks; they do not blend adjacent DEM samples or implement dynamic LOD/parent terrain fallback.

The existing 14-assertion terrain script runs in actual native-library QuickJS and browser main-thread/Worker with terrain/exaggeration/off/restore pixel evidence. Models check walls, nodata and surface-only picking. Portable script. External machines and devices remain separate acceptance work.