/** Offline, cluster-local static surface. Source material boundaries survive only in the sampling source. */ export interface HlodSurface { positions: Float32Array; normals: Float32Array; uvs: Float32Array; indices: Uint32Array; /** One material index for each triangle. */ materials: Uint32Array; /** Authored tangent xyz + handedness; w=0 requests a UV-derived frame for that vertex. */ tangents?: Float32Array; } export interface HlodImage { data: Uint8Array; width: number; height: number; wrapS?: number; wrapT?: number; /** Column-major UV transform; default is identity. */ transform?: readonly number[]; } export interface HlodMaterial { baseColor: readonly [number, number, number, number]; roughness: number; metalness: number; baseColorMap?: HlodImage; normalMap?: HlodImage; normalScale?: number; metallicRoughnessMap?: HlodImage; occlusionMap?: HlodImage; occlusionStrength?: number; emissive?: readonly [number, number, number]; emissiveMap?: HlodImage; } export interface HlodBakeOptions { atlasSize: 128 | 256 | 512 | 1024; triangleRatio: number; /** Absolute geometric simplification error in cluster coordinates (metres). */ maxErrorM: number; signal?: AbortSignal; } export interface HlodGeometry { positions: Float32Array; normals: Float32Array; uvs: Float32Array; indices: Uint32Array; } export interface HlodBakeMetrics { sourceTriangles: number; outputTriangles: number; sourceMaterials: number; outputMaterials: number; simplifyErrorM: number; maxProjectionDistanceM: number; sampledTexels: number; projectionMisses: number; simplifyMs: number; unwrapMs: number; transferMs: number; totalMs: number; estimatedScratchBytes: number; } export interface HlodBakeResult { geometry: HlodGeometry; baseColor: Uint8Array; normal: Uint8Array; orm: Uint8Array; emissive?: Uint8Array; metrics: HlodBakeMetrics; }