import { type PlacementRecord } from '@hypersoniclabs/helix-manifest'; import { type OuterLandField } from '../terrain/outerLand'; import { type OpenSeaProbe } from './openSea'; /** * How far past the border trees stand. The engine draws distant tree pages to the scene's declared `placements.distant.distanceM` * (set from this reach by `outerTreeDistanceM`) and lowers it per quality tier, so a camera on the border sees the whole band on a * desktop and the part of it its tier affords on a phone. Counts: a CS2-sized map plants about 2.5 times as many trees at 8 km as at 4 km * (Leonida 184k at 4 km, so about 450k), inside `OUTER_TREE_MAX` and the million-tree declaration cap; the runtime keeps residency inside its * 16 MiB distant cache whatever the declaration holds, and the memory proof counts only the atlases. */ export declare const OUTER_TREE_REACH_M = 8192; /** The `placements.distant.distanceM` a bake with outer trees up to `reachM` asks the engine for: the whole band, to the next kilometre. */ export declare function outerTreeDistanceM(reachM?: number): number; /** Hard ceiling, whatever the border density (Leonida's forested north and west need well under it). */ export declare const OUTER_TREE_MAX = 600000; export interface OuterTreesInput { boundsXZ: [[number, number], [number, number]]; /** The surround (`outerLandField`). */ field: OuterLandField; seaLevelY: number; /** The city's own ground (scene Y), for the land area behind each border stretch. */ coreHeightAt: (x: number, z: number) => number; /** The city's trees: plan position and prototype index. */ trees: ReadonlyArray<{ x: number; z: number; prototype: number; }>; /** The open sea as the ocean file draws it; a tree on one of its wet samples under the surface is left out, as in the city (`vegetation/openSea.ts`). */ openSea?: OpenSeaProbe; reachM?: number; } export interface OuterTreesPlan { records: PlacementRecord[]; /** Trees per km² of land measured behind each border stretch, in perimeter order (north, east, south, west). */ borderDensity: number[]; } /** The surround as drawn: the field at the mesh's lattice posts, interpolated over the same two triangles per cell the mesh draws. */ export declare function outerLandDrawnAt(boundsXZ: [[number, number], [number, number]], field: OuterLandField): (x: number, z: number) => number; export declare function planOuterTrees(input: OuterTreesInput): OuterTreesPlan; /** The city's trees in a placements bake: plan position and prototype of every record whose prototype has a distant atlas. */ export declare function readBakeTrees(bakeDir: string): Promise>; /** * Adds `records` to the bake in `bakeDir` as distant-only tree pages (no region holds them: they have no detailed model). Rewrites * `placements.json` through a validated pending file. `distanceM` is the scene's requested draw distance for the distant pages * (`outerTreeDistanceM`); it is written only when pages were added. Returns the pages and bytes added. */ export declare function appendDistantOnlyTrees(bakeDir: string, records: PlacementRecord[], options?: { distanceM?: number; }): Promise<{ pages: number; instances: number; bytes: number; }>;