hex-world
    Preparing search index...

    Interface WaterGeometryOptions

    interface WaterGeometryOptions {
        noiseScale?: number;
        perturbStrength?: number;
        elevationScale?: number;
        surfaceLift?: number;
        waterTerrains?: Set<number>;
        allLiquidTerrains?: Set<number>;
        terrainNoiseScale?: number;
        terrainPerturbStrength?: number;
        terrainElevPerturbStrength?: number;
        ownsUnclassifiedRivers?: boolean;
        liquidPriorityByTerrain?: Map<number, number>;
        riverCells?: Set<number>;
        depthShoreFalloff?: number;
        cliffThreshold?: number;
        riverFlow?: Map<number, number>;
        riverElevations?: Map<number, number>;
    }
    Index

    Properties

    noiseScale?: number
    perturbStrength?: number
    elevationScale?: number
    surfaceLift?: number

    Constant world-space Y added to every water surface position after the elevation scale is applied. Prevents z-fighting between the water mesh and coplanar terrain (e.g. a cell at elevation 0 connected to the ocean). Default 0.02.

    waterTerrains?: Set<number>

    Set of terrain indices that count as water. Defaults to {5} (built-in Water).

    allLiquidTerrains?: Set<number>

    Set of ALL liquid terrain indices across every liquid type. When provided, river geometry is only built for river cells that drain into a terrain in waterTerrains. Cells draining into a different liquid type (in allLiquidTerrains but not waterTerrains) are skipped so each liquid type only owns the rivers that flow into it.

    terrainNoiseScale?: number

    Terrain-mesh noise parameters, matching the ChunkGeometryOptions used to build the terrain. Land-side shore/estuary vertices and river channels are perturbed with these — not the liquid's own noiseScale/perturbStrength — so they stay glued to the terrain even when a liquid overrides its surface noise settings. ChunkManager injects these automatically from its geometryOptions.

    terrainPerturbStrength?: number
    terrainElevPerturbStrength?: number
    ownsUnclassifiedRivers?: boolean

    When true, this liquid also renders river chains whose drainage target could not be classified (the river dries out on land, leaves the map, or exceeds the trace limit). ChunkManager sets this on exactly one liquid — the highest-priority one with a river material — so unclassified rivers are drawn once instead of once per liquid type. Ignored when allLiquidTerrains is unset (single-liquid backward-compat mode renders everything).

    liquidPriorityByTerrain?: Map<number, number>

    Terrain index → liquid priority (the lowest terrain index of the liquid that index belongs to). Used at liquid-liquid boundaries so liquids spanning multiple terrain indices compare at the liquid level. Falls back to the raw terrain index when absent.

    riverCells?: Set<number>

    Cells (row * width + col) whose river channels this liquid should render — the pre-computed ownership set from ChunkManager's map-wide river classification cache. When provided, buildRiverGeometry skips its own per-chunk drainage tracing entirely.

    depthShoreFalloff?: number

    Shore distance (in cells) at which the surface reaches full deep color. Depth blends the larger of bathymetric depth and shore-distance depth, so both carved basins and wide bodies read as deep. Default 6.

    cliffThreshold?: number

    Elevation difference at which a river edge renders as a waterfall (level lip + steep drop) instead of one smooth slope. Should match the terrain's ChunkGeometryOptions.cliffThreshold; ChunkManager injects it. Default 2.

    riverFlow?: Map<number, number>

    Accumulated river flow per cell (cellKey → flow, from computeRiverFlow). When provided, river channels widen with flow (see RiverWidth.ts). Must be the SAME map passed to buildChunkGeometry so the carved stream bed widens in lockstep. ChunkManager injects its cached flow automatically.

    riverElevations?: Map<number, number>

    Carved river elevation per cell (cellKey → elevation, from computeRiverElevations): the running minimum along flow. When provided, the river surface holds the carried level through uphill stretches (whose terrain carves a gorge) instead of climbing them. Must be the SAME map passed to buildChunkGeometry. ChunkManager injects it automatically.