import type { Cs2MeshDirectory } from './csm2'; import type { Cs2MaterialBundle } from './materials'; /** The atlas, texels: wide enough for the North American sheet at half size and four more sheets at a quarter. */ export declare const SIGN_ATLAS_SIZE: readonly [number, number]; /** Slots as [x, y, width, height] texels, largest first; the most-used sheet takes the first. */ export declare const SIGN_ATLAS_SLOTS: ReadonlyArray; /** An atlas: its size and its slots ([x, y, width, height] texels, largest first). */ export interface SignAtlasSpec { size: readonly [number, number]; slots: ReadonlyArray; } /** The street-furniture layer's atlas (desktop): five sheets. */ export declare const SIGN_ATLAS: SignAtlasSpec; /** * The phone's sign atlas: the most-used sheet alone at a quarter size (the North American sheet carries STOP, YIELD, the speed * limits, DO NOT ENTER and the FREEWAY shield). 0.33 MiB on the GPU against the desktop atlas's 2.7, because a phone bills it in every * ground tile that carries signs. A sign whose sheet is not in it is left off the phone. */ export declare const PHONE_SIGN_ATLAS: SignAtlasSpec; /** A sheet's place in the atlas, in UV: u = u0 + u_sheet * su, v = v0 + v_sheet * sv (top-left origin, as the capture and glTF). */ export interface SignAtlasRect { slot: number; u0: number; v0: number; su: number; sv: number; } /** Pure: sheets by use (instances drawn with them), most used first, ties by name; sheets past the last slot get none. */ export declare function signAtlasLayout(uses: ReadonlyMap, spec?: SignAtlasSpec): Map; /** * Pure: a sheet UV inside its slot. The game's sign UVs lie on the sheet (0..1); one a hair outside is clamped, and the result is * held half a texel inside the slot so a bilinear tap never reads the neighbouring sheet. */ export declare function atlasUv(u: number, v: number, rect: SignAtlasRect, spec?: SignAtlasSpec): [number, number]; export interface SignFacePrototype { positions: Float32Array; uvs: Float32Array; indices: Uint32Array; trianglesBefore: number; } /** The base sheets a prefab's drawn (non-decal) groups sample, by file. Empty when it has no mesh groups with a base map. */ export declare function signSheets(prefab: string, meshes: Cs2MeshDirectory, materials: Cs2MaterialBundle): Promise; /** * One sign, whole, with atlas UVs: every drawn group's triangles, each group's vertices copied (a vertex shared by two sheets gets one * copy per sheet). Null when a group has no sheet in the atlas or the mesh has more than `maxTriangles` triangles. */ export declare function buildSignFacePrototype(prefab: string, meshes: Cs2MeshDirectory, materials: Cs2MaterialBundle, rectOf: (file: string) => SignAtlasRect | undefined, maxTriangles: number, spec?: SignAtlasSpec): Promise; /** Pure: textured instances merged into one world-space mesh (positions, atlas UVs, indices). */ export declare function mergeSignFaces(instances: ReadonlyArray<{ prototype: SignFacePrototype; position: readonly number[]; quaternion: readonly number[]; }>): { positions: Float32Array; uvs: Float32Array; indices: Uint32Array; }; /** * Pure: the atlas RGBA. Each sheet (straight RGBA, any size) is resampled to its slot (the UVs are normalised, so a sheet that is not * square stretches with them) and its LINEAR capture bytes encoded to sRGB once (`capturedLinearToSrgb`); empty slots stay mid grey. */ export declare function packSignAtlas(sheets: ReadonlyArray<{ rect: SignAtlasRect; image: { data: Uint8Array; width: number; height: number; }; }>, spec?: SignAtlasSpec): Uint8Array; /** Reads each sheet (fitted to its slot) and encodes the atlas as an sRGB ETC1S KTX2 with mips. */ export declare function buildSignAtlas(layout: ReadonlyMap, materialsDir: string, spec?: SignAtlasSpec): Promise;