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...
function refineTerrain(
coarse: Terrain,
k: number,
opts?: FineTerrainOptions
): FineTerrain;Defined in: fine.ts:103
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 pebbles on beds and paths. Only a skin of ground is written, so cost follows the
surface. Edits to coarse.heights (levelled pads) carry through.
Parameters
| Parameter | Type | Description |
|---|---|---|
coarse | Terrain | The terrain at 10 voxels per metre. |
k | number | Fine voxels per coarse voxel (2, 5 or 10; any integer works). |
opts? | FineTerrainOptions | Blade density and height, skin depth, seed and a default top override. |
Returns
The fine terrain; stream it brick by brick, editing a box per brick column
(columnSpan).
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...
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.