import { type FacadeLanes } from '../city/buildings/facade'; export type BuildingZone = 'residential' | 'commercial' | 'office' | 'industrial' | 'mixed' | 'rural' | 'civic'; export type BuildingDensity = 'low' | 'medium' | 'high'; export interface BuildingKind { prefab: string; zone: BuildingZone; density: BuildingDensity | null; region: 'EU' | 'NA' | null; /** The `_L` level suffix, or null (signature and service buildings have none). */ level: number | null; } /** `EU_ResidentialLow01_L5_2x2_<32 hex>` and `..._Win_<32 hex>` both reduce to the prefab's own name. */ export declare function prefabOfMaterialName(materialName: string): string; export declare function classifyPrefab(name: string): BuildingKind; /** sRGB multipliers (0..1). The albedo is grey, so a colour here is the colour the wall reads as, times the grey's value. */ export type Srgb = readonly [number, number, number]; export interface Scheme { name: string; /** Mask red, green, blue: the main wall, a second wall or roof, and the trim. */ colors: readonly [Srgb, Srgb, Srgb]; } /** Share of its own chroma every palette colour keeps (1 = the first, saturated stand-in; 0 = its luminance grey). */ export declare const CHROMA_KEEP = 0.5; /** The saturated primaries (red, orange, yellow, teal, green, blue) and the pinks and mints keep less: CS2 has almost none of them. */ export declare const ACCENT_CHROMA_KEEP = 0.35; /** * Blend an sRGB colour toward its own luminance grey. Done in linear light on `Y = 0.2126 R + 0.7152 G + 0.0722 B`, so the colour keeps * its luminance exactly (the albedo it multiplies keeps its brightness) and only the chroma shrinks, by `keep`. */ export declare function muteColor([r, g, b]: Srgb, keep: number): Srgb; /** Every list holds a prime number (11) of schemes so a stride through it never repeats before the list is spent. */ export declare function schemesFor(kind: BuildingKind): readonly Scheme[]; /** FNV-1a over UTF-16 code units, then an avalanche. Stable across platforms: the restyle and its tests depend on it. */ export declare function hash32(text: string): number; /** * How many colourways a pool of prototypes gets, by how many buildings wear it (Granit: the three biggest pools are 1,498, 1,395 and * 1,362 buildings; one colour for all of them is the grey city again). Each colourway is a distinct appearance (a material the * renderer switches to) and a copy of the geometry (0.2 to 0.9 MB), so the ladder stops at 8 and a pool under 10 buildings stays one. */ export declare function variantCountFor(instances: number): number; /** Which colourway building `entityId` wears: uniform over the prototype's variants, independent of every other building. */ export declare function variantIndex(entityId: number | string, variants: number): number; /** Scheme of variant `k` of a prototype: a stride walk through the zone's list, so a prototype's variants never repeat. */ export declare function schemeOf(kind: BuildingKind, prototypeKey: string, k: number): Scheme; /** A small deterministic value jitter (+-5 %) per prototype variant, so two variants with the same scheme still differ. */ export declare function jitterOf(prototypeKey: string, k: number): number; /** * The albedo of a `surface` group whose colour map the capture could not resolve (a virtual-textured material: 5,301 of Granit's 5,813 * point at a texture the bundle does not carry). There is no data to recover, so the surface takes the commonest real answer, weathered * concrete, at a mid value. The old flat factor was a pale `#bdb9b0` (linear 0.5): a harbour deck of 448 x 255 m and every other big * slab of an industrial or civic site (318 of Granit's 778 prototypes have one) read as a near-white plate in full sun. */ export declare const FLAT_SURFACE_SRGB: Srgb; /** Linear-light base colour factor of a flat `surface` group: weathered concrete, leaning toward the colourway's main colour by the zone's share. */ export declare function flatSurfaceLinear(kind: BuildingKind, scheme: Scheme, jitter?: number): [number, number, number]; /** * The albedo of the GROUND of an uncaptured surface: its up-facing faces at the prefab base (a harbour deck, a depot yard, an apron, a car park; roofs keep the concrete). In * CS2 these are paved lots, asphalt and tar, and the 0.22 concrete a wall takes renders them as a near-white plate: measured in the * live Granit World (granit-v5a, desktop, sun 10.5 h), the harbour deck's pixel is `0.16 + 2.5 * albedo` in linear light, so 0.22 lands * at 0.72 (sRGB 220) while the asphalt road beside it renders 0.17 and the rail yard 0.27 to 0.34. At this value the deck lands at * about 0.3 from overhead, in the band of the paved ground the capture did resolve. Neutral: a lot is not painted in the colourway. */ export declare const FLAT_GROUND_SRGB: Srgb; /** Linear-light base colour factor of the up-facing ground of a flat `surface` group (see `FLAT_GROUND_SRGB`). */ export declare function flatGroundLinear(jitter?: number): [number, number, number]; /** Linear-light multipliers of a scheme's three colours, value-scaled by `jitter`. */ export declare function schemeLinear(scheme: Scheme, jitter?: number): [number, number, number][]; export interface TintResult { /** RGBA, same size as the input; alpha untouched. */ data: Uint8Array; /** Mean linear-light tinted / untinted over the opaque pixels, per channel: the colour a far mesh carries instead. */ ratio: [number, number, number]; /** Share of opaque pixels the mask colours. */ coverage: number; } /** * `albedo * (1 + sum_i w_i * (colour_i - 1))` in linear light, where `w` is the control mask's red/green/blue weight at the * pixel (clamped so the three never sum past 1). Pixels outside the mask keep the captured albedo, which is how a window, a door or * a painted-brick patch keeps its own colour. Both images are RGBA, the same size; `mask` may be RGB-only (alpha ignored). */ export declare function tintAlbedo(albedo: Uint8Array, mask: Uint8Array, linearColors: readonly [number, number, number][]): TintResult; /** A vertex colour byte for a linear ratio. glTF `COLOR_0` is linear, so no transfer function. */ export declare const ratioToByte: (ratio: number) => number; export interface FacadeLook { /** Index into the engine's `FACADE_FAMILIES` (the CLI building generator's names are the base table). */ family: number; familyName: string; floorHeightM: number; groundType: number; bayWidthM: number; windowRatio: number; /** Tint palette index, 1..255 (0 is neutral). */ tint: number; /** `_FACADE` lanes without the per-building seed (lane x low 10 bits) and height (lane w high byte): `facadeLanes` fills them. */ lanes: FacadeLanes; } /** * The engine facade parameters for a prototype: a style family by zone and colourway, a floor height and bay width by * zone, a glazed share by zone, and the tint palette entry that matches the colourway. `heightM` and `seed` are per * building and go through `facadeLanes`. NOT yet consumed at the HLOD tiers: the shared-material pool replaces every * cluster mesh's material (`hlod/resources.ts`), so a `HELIX_materials_city` primitive there is discarded. */ export declare function facadeLookFor(kind: BuildingKind, prototypeKey: string, k: number): FacadeLook; /** `_FACADE` lanes of one building: its prototype's look plus its own height class and seed. */ export declare function facadeLanes(look: Pick, heightM: number, seed: number): FacadeLanes;