// pipeline — end to end
TerraSketch runs as a single CLI pass over a WGS84 bounding box. The box is projected into
Lambert-93 (EPSG:2154) so every downstream step works in real metres, with a local
south-west origin that maps straight onto Unity's X/Z. Elevation is IGN's RGE ALTI 1 m
bare-ground model, fetched as a GeoTIFF and resampled into a 16-bit heightmap whose smoothing is
fixed in metres, not pixels — so the relief stays stable across output resolutions.
That heightmap is diced into an N×N grid of chunk meshes with multiple LOD levels and an
extruded soil skirt, then a relief-normal map is baked from the full-resolution surface so
even a low-poly chunk reads as detailed. In parallel, BD ORTHO aerial imagery is pulled
from the IGN WMTS at ≈0.45 m/px, aligned to the terrain, LAB-graded into a stylized colour map,
and classified into a biome splatmap — slope and altitude overriding a k-means clustering of
the aerial colours into grass / rock / forest / water weights.
Vector features come from OpenStreetMap via the Overpass API: the highway hierarchy is
Chaikin-smoothed, rasterized into an anti-aliased road mask and carved into the heightmap with
graded shoulders, while a chosen waterway is draped onto the surface as a tapered ribbon and cut into
a meandering channel whose bed can only descend downstream. IGN LiDAR HD canopy heights
plus a Bridson Poisson-disk sampler drive multi-layer tree / rock / grass scatter, BD TOPO
footprints extrude into gable-roofed buildings, and everything is written out as OBJ/FBX meshes, PNG
textures and a JSON manifest — a self-describing bundle the Unity importer reads in one step.
↑ One command turns a lat/lon bounding box into this: IGN 1 m elevation, BD ORTHO aerial texture,
the OSM road/track network and a carved river — orbiting in an interactive viewer.
The exported terrain block — draped BD ORTHO imagery, the extracted road/track network, a carved river
channel, semantic POI pins, and the extruded soil skirt under the surface.