voxolith
API reference@voxolith/gen-terrainFunctions

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

ParameterTypeDescription
coarseTerrainThe terrain at 10 voxels per metre.
knumberFine voxels per coarse voxel (2, 5 or 10; any integer works).
opts?FineTerrainOptionsBlade density and height, skin depth, seed and a default top override.

Returns

FineTerrain

The fine terrain; stream it brick by brick, editing a box per brick column (columnSpan).

On this page