fineTerrainInit()
Describe a fine terrain as data for a worker. top (default: the fine terrain's options.top) is evaluated on every coarse column once, so a closure over app state (a settlement's paths and yards) becomes a Uint8Array. Heights are copied as they are now: level before calling.
function fineTerrainInit(fine: FineTerrain, top?: TopOverride | undefined): FineTerrainInit;Defined in: init.ts:35
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
fine | FineTerrain | undefined | The fine terrain, from refineTerrain. |
top? | TopOverride | undefined | fine.options.top | The override its bricks are filled with, when the app passes it per call instead of in the options. |
Returns
Structured-clonable data; fineTerrainFrom rebuilds a fine terrain whose
fillBrick (with no top argument) writes the same cells.
fineTerrainFrom()
Rebuild a fine terrain from fineTerrainInit data, on a worker or anywhere: the coarse terrain from its heights (nothing is resampled) and the refinement over it. Cheap (the cost is one pass over the heights for maxY); every brick then fills byte-identically to the original.
generateTerrain()
Generate a region of ground and water: layered-noise hills, a meandering river carving its valley, lakes wherever the ground dips below the water level, and a surface role per column by slope, height and nearness to water (grass, dry grass, rock, sand, gravel, mud). The height map is sampled...