import type { ItemModel, ModelImage } from './model'; import { type MipChain } from './mips'; /** * Paint fidelity of a level against its source (HELIX-95: a McLaren F1 drew tan at full detail and pale grey at LOD1). * * `renderAlbedo` rasterises a model's unlit base colour (the base colour texture sampled bilinearly at full resolution through * its UV set and KHR_texture_transform, times the material's base colour factor and vertex colour) from the six axis directions * with a z-buffer, 4x supersampled and box-filtered, so it is what a camera at a distance sees before lighting. Blended * materials (glass) are left out: they show what is behind them. It reads the decoded level file, not the compiler's own * bookkeeping, so a bug anywhere between source and written file (a lost texture or transform, the wrong UV set, an atlas * rectangle that blurs thin islands into their neighbours, a footprint folded to a mean colour) shows up here. * * `compareAlbedo` fails a level when its mean colour over the pixels both draw is further than `ALBEDO_MEAN_LIMIT` from the * source's, or when more than `ALBEDO_BLOCK_SHARE` of the surface (in `BLOCK` px blocks, tolerant of the simplified silhouette) is * further than `ALBEDO_BLOCK_LIMIT` from it. A failing level is not shipped: the runtime keeps the item at full detail. */ export declare const ALBEDO_MEAN_LIMIT = 24; export declare const ALBEDO_BLOCK_LIMIT = 48; export declare const ALBEDO_BLOCK_SHARE = 0.15; export type Rgb = [number, number, number]; export interface AlbedoRender { size: number; views: Array<{ rgb: Float32Array; covered: Uint8Array; }>; } export interface AlbedoBounds { min: readonly number[]; max: readonly number[]; } /** Six axis views of the model's linear base colour. `bounds` frames every view, so a source and its level are drawn on the same grid. */ export declare function renderAlbedo(model: ItemModel, chainOf: (image: ModelImage) => Promise, bounds: AlbedoBounds): Promise; export interface AlbedoVerdict { ok: boolean; meanDelta: number; badShare: number; source: Rgb; level: Rgb; reasons: string[]; } /** * Compares a level's render with its source's: the mean colour over the pixels both draw, and the share of `BLOCK` px blocks * (both drawn, half covered or more) whose mean colour is further than `ALBEDO_BLOCK_LIMIT` from the source's. */ export declare function compareAlbedo(source: AlbedoRender, level: AlbedoRender, limits?: { mean: number; block: number; share: number; }): AlbedoVerdict; /** Convenience: render a source and a level on the source's grid and compare them. */ export declare function levelAlbedoVerdict(source: ItemModel, level: ItemModel, chainOf: (image: ModelImage) => Promise, limits?: Parameters[2]): Promise;