import { type HeightGrid, type TerrainPreset, type TerrainResample, type TerrainSplatSource } from '../../terrain'; import { type Cs2TerrainGrid } from '../terrain'; import { type Cs2WaterField } from '../water'; export interface Cs2TerrainOptions { /** The AUTHORING grid's posting, one of `TERRAIN_SAMPLE_SPACINGS`; default 4. */ outputMetresPerSample?: number; /** Which heights LOD to resample from; default the finest the bundle ships. */ heightsResolution?: number; /** Depth in metres that counts as water, for both the cut and the wet mask; default 0.02. */ cutDepthMetres?: number; /** Which role each splat channel paints; default `{ R: 'base', G: 'low' }`. */ splatRoles?: TerrainSplatSource['roles']; resample?: TerrainResample; } export interface Cs2TerrainConversion { /** Heights re-based so the water surface is 0, with the water cut applied. */ grid: HeightGrid; /** The bundle's splat over the grid's extent, bound to the roles above. */ splat: TerrainSplatSource; /** Whether a world position is water, on the same threshold the cut used. */ wet(x: number, z: number): boolean; /** The offset that was subtracted from every height. */ seaLevelMetres: number; extentMetres: number; tilesX: number; tilesZ: number; /** Of the re-based, cut grid. */ heightRange: [number, number]; /** Share of the grid's samples the cut lowered. */ wetFraction: number; /** The heights LOD the grid was resampled from. */ heightsResolution: number; } export interface Cs2HeightGridOptions { /** Subtracted from every height, so the water surface lands on zero. */ seaLevelMetres: number; outputMetresPerSample?: number; resample?: TerrainResample; /** What the grid's provenance names where a file path would stand. */ label?: string; } export interface Cs2WaterCut { wet(x: number, z: number): boolean; wetFraction: number; } /** Reads the bundle's terrain, water and splat, and hands back everything the tiler, the bake and the ocean need. */ export declare function convertCs2Terrain(bundleRoot: string, options?: Cs2TerrainOptions): Promise; /** * The bundle's heights on the authoring grid, re-based on sea level. The resampler centres the source on the target, * so a tile count that falls short of the world crops symmetrically and the origin moves in by half the shortfall. */ export declare function cs2HeightGrid(heights: Cs2TerrainGrid, options: Cs2HeightGridOptions): HeightGrid; /** * CS2's landscape heightmap is filled to the waterline, so the sea floor only exists once the depth field is cut back * into it. Heights are already re-based, so `seaLevel - depth` is simply `-depth`. */ export declare function applyCs2WaterCut(grid: HeightGrid, water: Cs2WaterField, cutDepthMetres?: number): Cs2WaterCut; /** * Depth at a world position, bilinear over the field's own scale and offset with its Z mirror. The samples are posted * at cell origins, so the last cell reaches one sample past the last post; past that the field does not cover the world. */ export declare function cs2WaterDepth(field: Cs2WaterField, worldX: number, worldZ: number): number; /** * A CS2 city landscape off the meadow preset, keeping its macro variation and blend sharpness: grass and dry dirt come * from the bundle's splat channels, cliffs from the slope rule, and nothing paints cavities or accents. */ export declare function cs2TerrainPreset(): TerrainPreset;