terrainHeight()
The height function on its own: pure in (x, z), for a world that streams columns without ever sampling the whole map. Gives exactly the values generateTerrain samples into heights, before any editing.
function terrainHeight(params: TerrainParams, seed: number): (x: number, z: number) => number;Defined in: index.ts:191
Parameters
| Parameter | Type | Description |
|---|---|---|
params | TerrainParams | Complete params (completeTerrainParams fills the defaults). |
seed | number | The same seed as the terrain it should match. |
Returns
Ground height (top solid voxel) of a column, rounded.
(x: number, z: number) => number
refineTerrain()
The same terrain k times finer, for a world at 20, 50 or 100 voxels per metre. Nothing is built up front: the result wraps coarse and fills any brick on demand, with a bicubic surface through the coarse column tops, organic boundaries between surface roles, grass blades on grassy ground and...
terrainHeightsBand()
Sample the rows z0 <= z < z1 of the height map, the unedited values generateTerrain samples into heights there. Bands are independent, so workers can each sample one and the host stitches them (heights.set(band, z0 width)) and passes the result to generateTerrain(params, seed, { heights }): byte...