import type { ObjectTextureCuts } from './phoneObjectTextures'; export type TierName = 'desktop' | 'mobile'; export interface PrototypeProfile { /** Simplify a prototype above this many triangles. */ maxTriangles: number; /** Longest edge of a colour map, px. */ albedoEdge: number; /** Longest edge of a normal or ORM map, px. */ dataEdge: number; /** Colourways per prefab. */ maxVariants: number; /** A prefab wider than this is cut into tile models, metres (a streamed cell is limited to 1,024 m by P05). */ maxSide: number; } export interface PartsProfile { /** Declared memory cap of one near group, MiB (desktop gate refuses 64, mobile gate 24). */ groupCapMiB: number; /** At most this many parts (8 is the engine's resident-mount limit; the phone's mount commitments need fewer). */ maxParts: number; /** * The part count the orchestrator starts from (default `maxParts`); it adds a part only when a cut does not fit the 512 stream groups a document holds. * Every part a phone mounts promises at least 32 MiB of its 192, so the phone starts from the fewest parts that fit. */ preferredParts?: number; /** A near group draws at most this many calls. The phone gate (P06) refuses a camera cell drawing over 150: four resident groups meet at a corner. */ groupDraws?: number; /** HLOD bake cell size written into each part (`bake-complete` reads it); larger cells mean fewer cluster draws. */ hlodCellM?: number; /** Cut the parts to hold equal numbers of stream groups, not buildings (`buildingParts.ts balanceGroups`): the densest part decides the part count otherwise. */ balanceGroups?: boolean; /** The coarse level's maximum simplification error, metres (written into each part's HLOD layer; the bake reads it). Absent: 2. */ hlodMaxErrorM?: number; } export interface BakeProfile { /** Independent coarse HLOD cell, metres. */ cellSize?: number; /** Smallest atlas tile, px (32 lets the thousands of small buildings cost 32 px, which is what keeps a phone atlas small). */ minTile?: number; /** Largest atlas tile, px. */ maxTile?: number; /** Shared appearance density, texels per metre. */ texelsPerMetre?: number; } /** How the skyline atlas (the shared HLOD carrier the phone looks at from 100 m to 6 km) is capped by truncating its KTX2 mip chain. */ export interface SkylineAtlasPolicy { /** A carrier whose base image is at least this wide is the skyline atlas. */ minSide: number; /** Per image caps in carrier order: base colour, normal, occlusion-roughness-metal. Granit #1139: 1024 / 512 / 512 (256 left a 100 m tower about two texels per window). */ maxDims: readonly [number, number, number]; } export interface ComposeProfile { /** The root `world` profile's memory budget, MiB. */ budgetMiB: number; /** Near-model residency each part may add beyond its largest group, its distant mass and its atlas, MiB. */ nearAllowanceMiB: number; /** How far from the camera the full models of a part stream in, metres. */ nearRadiusM: number; /** The root's streaming radius for the landscape, metres (omitted: the landscape's own). */ streamRadiusM?: number; /** Used only when `hlodAtlas` is `scaled`: the fraction of the bake's uncompressed-RGBA worst case the shared atlas is declared at. */ hlodMaterialScale: number; /** `decoded`: the distant mass is declared as the engine counts it (accessor sizes, twice), never above the bake's own figure. */ hlodGeometry: 'declared' | 'decoded'; /** `decoded`: the shared atlas is declared as the engine counts it (KTX2 header size, transcoded 8 bpp with mips, twice). */ hlodAtlas: 'scaled' | 'decoded'; /** A bake cell's near models are cut until each piece costs at most this, MiB; each piece is its own stream group. */ groupCapMiB: number; /** Near models are first split by this square grid (metres) so a stream group never spans more than one cell; Granit streams in 128 m cells. */ cellM: number; /** Lower the shared HLOD atlas on compose. Absent: leave it as baked. */ skylineAtlas?: SkylineAtlasPolicy; /** Cut these city-material library slots (slot -> top mip levels) out of the root's own copy of the library (src/cs2/convert/phoneLibrary.ts). Absent: the library as the landscape package has it. */ libraryCuts?: Readonly>; /** Cut the top mip levels of the placement objects' textures out of the root's own copy (src/cs2/convert/phoneObjectTextures.ts). Absent: the textures as the landscape package has them. */ objectTextureCuts?: ObjectTextureCuts; /** Halve the coarse terrain normal map this many times in the root's own copy (src/cs2/convert/phoneTerrainNormal.ts). Absent: as the landscape package has it. */ terrainNormalCut?: number; /** Halve the coarse terrain splat map this many times in the root's own copy (src/cs2/convert/phoneTerrainSplat.ts). */ terrainSplatCut?: number; /** * What a mounted part promises its parent (the mount's `budgetMiB`, which the parent bills as one eager group and the road-budget audit sums). * A promise below the part's own HLOD level and near fill is charged again on top by the engine, so it is derived from what the part holds. */ mountPromise: MountPromisePolicy; } export interface MountPromisePolicy { /** The promise is never below this, MiB. */ floorMiB: number; /** * `held`: the promise is what the part keeps resident: its complete HLOD level at `hlodResidentShare` of the declared decode-time bytes (the engine * holds a complete level at half of them once the renderer has uploaded it and released the CPU copies), plus its share of `nearPoolMiB`, the fine * models the whole mounted set may hold at once (parts share one promise, so the pool is split evenly). Absent: the promise is the floor alone. */ held?: { hlodResidentShare: number; nearPoolMiB: number; }; } export interface TierProfile { prototypes: PrototypeProfile; parts: PartsProfile; bake: BakeProfile; compose: ComposeProfile; } /** * Granit's phone skyline atlas (helix-web-engine-new #1139): base colour 1024 px, normal and ORM 512 (256 left a 100 m tower about two * texels per window). Granit's bake makes four 2048 x 1024 carriers that its phone composition truncates to this. Select it on a * bake that came out larger than a phone should hold: `compose --skyline-atlas 1024,512,512`. */ export declare const GRANIT_SKYLINE_ATLAS: SkylineAtlasPolicy; /** * What the mobile profile applies by default. The CLI's `bake-complete --profile mobile` already bakes the shared skyline atlas at * phone density (Leonida: 2048 x 1344 base for 8,748 buildings, 316 base texels a building; Granit's four 1024 x 512 carriers over * 13,377 buildings are about 157), so truncating it to Granit's numbers would HALVE what the phone shows and free no budget (measured: * the P01 proof is the same 174.46 MiB either way). The default is therefore a guard against an oversized bake (a 4096 px atlas), not a cut. */ export declare const SKYLINE_ATLAS_CAP: SkylineAtlasPolicy; /** * The phone's mount promise. The floor of 32 MiB a part used to promise made five parts bill 160 MiB of a 192 MiB budget before a road or a tree was * counted, while the live engine holds 73 of them (Leonida build 19, phone profile, `residency.now`: complete HLOD level 50.8 MiB, shared appearance 4.7, * the one part around the camera 17). Promising what the parts hold keeps the audit exact and gives the roads back the room they need. * `nearPoolMiB` is the largest fine-model residency of all parts together measured on a downtown walk (51 MiB, summed over the mounts). */ export declare const MOBILE_MOUNT_PROMISE: MountPromisePolicy; export declare const TIER_PROFILES: Record; export declare function tierProfile(name: string | undefined): TierProfile;