hex-world
    Preparing search index...

    Interface ChunkGeometryOptions

    interface ChunkGeometryOptions {
        elevationScale?: number;
        perturbStrength?: number;
        elevPerturbStrength?: number;
        noiseScale?: number;
        cliffThreshold?: number;
        colorMode?: TerrainColorMode;
        terrainDefinitions?: readonly ChunkTerrainColorSource[];
        fallbackColor?: PlainColor;
        riverFlow?: Map<number, number>;
        riverElevations?: Map<number, number>;
        riverbedTerrain?: number;
        riverBankFlare?: number;
        riverbedBlend?: number;
        bridges?: boolean;
        bridgeTerrain?: number;
        ambientOcclusion?: boolean | AmbientOcclusionOptions;
    }
    Index

    Properties

    elevationScale?: number
    perturbStrength?: number
    elevPerturbStrength?: number
    noiseScale?: number
    cliffThreshold?: number
    colorMode?: TerrainColorMode
    terrainDefinitions?: readonly ChunkTerrainColorSource[]

    Terrain definitions used for vertex color and road color lookups. Defaults to the built-in six.

    fallbackColor?: PlainColor

    Vertex color for terrain indices missing from terrainDefinitions.

    riverFlow?: Map<number, number>

    Accumulated river flow per cell (cellKey → flow, from computeRiverFlow). When provided, carved stream beds widen with flow (see RiverWidth.ts); the SAME map must be passed to buildRiverGeometry so the water channel 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 of cell elevations along the flow direction. When provided, stream beds carve to this level instead of the cell's own elevation, so rivers routed uphill cut a level gorge through rising terrain rather than the water climbing it. The SAME map must be passed to buildRiverGeometry so the water surface tracks the carve. ChunkManager injects its cached copy automatically.

    riverbedTerrain?: number

    Terrain index whose color/texture the carved stream-bed line blends toward, fading up the channel walls into each bank's own terrain (same splat blending as any terrain border). Undefined disables bed blending. ChunkManager auto-resolves this to the active terrain definition with id 'riverbed' unless set explicitly.

    riverBankFlare?: number

    Widens the TOP of carved river channels (the bank shoulders) relative to the water width, sloping the channel walls outward instead of leaving them near-vertical. 1 = the legacy slot-canyon look. Values above ~1.4 would surface the water sheet's lateral edges outside the banks, so the value is clamped to [1, 1.4]. Default 1.3.

    riverbedBlend?: number

    Splat-weight boost on riverbed vertices. Channel walls are fully riverbed (the bank shoulders carry full bed weight); the bed→bank fade happens on the flat land between the shoulder and the next vertex ring outward, crossing over at boost/(1+boost) of that span (1 = midway, 2 = two-thirds out). Splat color mode only — plain vertex colors always fade linearly. Default 1.

    bridges?: boolean

    Span a deck across the river in every cell where a road reaches both banks (see hasBridge). Default true; false leaves the two road stubs facing each other across the channel, which is what every map showed before decks existed.

    bridgeTerrain?: number

    Terrain index the bridge slab (its sides and underside) is textured and coloured as — the deck top is road. ChunkManager auto-resolves this to the active terrain definition with id 'rock' unless set explicitly; with neither, the slab takes the cell's own terrain.

    ambientOcclusion?: boolean | AmbientOcclusionOptions

    Bake per-vertex ambient occlusion from the height field into an occlusion attribute: true/omitted for the tuned defaults, false to skip it, or an AmbientOcclusionOptions object. Terrain and road shaders attenuate only their AMBIENT term with it, the same split sun shadows use — so cliff bases and carved gorges sit in their own soft shade while lit surfaces keep their full brightness. Geometry built without the attribute renders exactly as before (a missing attribute reads as 0 = fully open). Default true.