/** * Refuse a GLB whose `baseColorTexture` is a tangent-space NORMAL map. * * ── THE DEFECT (live 2026-09-29/30, 17 Cyberpunk add-ons) ─────────────────────────────────────────── * Cyberpunk 2077 garments carry no albedo image at all: their colour is the composite of a 20-layer * "Multilayered" shader (mask atlas x per-layer tints x shared microblend textures). Blender's glTF exporter * cannot evaluate that node group, so it walks the graph and binds the first image it can reach — a shared * microblend NORMAL map (`dirt_stains`, `dust_fine`, `default`) — as `baseColorTexture`. Every garment that * took that path rendered flat lavender (RGB ~128,128,255, a tangent normal map's "straight up") in the * catalogue thumbnail, and near-black with specular speckle in the 3D preview where the same image also sat in * `metallicRoughnessTexture`. * * ── WHY EVERY EXISTING GATE PASSED IT ─────────────────────────────────────────────────────────────── * `helix bridge validate`, the old Item-first publication dry run, the draw-call / triangle / material / texture-size * budgets, the leftover-body-geometry guard, the pose-aware fit, the skeleton checks and the engine bind check * are all structural or budget-based. None of them reads a pixel of the albedo, so "valid glTF, correct * skeleton, under budget" was true of a model that could not possibly look right. The only one that samples * the albedo (`bodyGeometryGuard`) does so to find untextured *islands*, not to ask whether the image is a colour. * * ── THE TESTS (any one refuses) ───────────────────────────────────────────────────────────────────────── * IDENTITY the baseColor image bytes are identical to the same material's normal / metallicRoughness / * occlusion image. A colour map is never the same file as its own normal map. (Only fires on * un-packaged PNG/JPEG: KTX2 encoding writes a colour and a linear copy of one source with * different bytes, so on a bridge-packaged file CONTENT is the rule that carries the weight.) * CONTENT the decoded pixels have a tangent normal map's signature: mean R,G within 14 of 128, mean B * above 215, and R/G spread under 22. Real normal maps cluster tightly around (128,128,255) because * most of a surface faces its own normal; a real albedo with that colour AND that flatness is a * solid periwinkle fill, which belongs in `baseColorFactor`, not in a texture. * A texture that cannot be decoded is reported as UNCHECKED and does NOT refuse (a gap in this checker must not * become a creator's dead end — same precedent as the mesh preflight), but it is surfaced to the caller. * * Escape hatch for a genuine periwinkle fill: `HELIX_ALLOW_NORMAL_MAP_BASE_COLOR=1`. */ import type { Document } from '@gltf-transform/core'; export interface BaseColorFinding { material: string; texture: string; reason: 'identity' | 'content'; detail: string; } export interface BaseColorReport { findings: BaseColorFinding[]; /** Materials whose baseColor image could not be decoded, so no content verdict was possible. */ unchecked: string[]; } export declare const NORMAL_MAP_MEAN_TOLERANCE = 14; export declare const NORMAL_MAP_MIN_BLUE_MEAN = 215; export declare const NORMAL_MAP_MAX_RG_STDEV = 22; export declare function inspectBaseColor(document: Document): Promise; export declare function describeBaseColorFindings(findings: readonly BaseColorFinding[]): string; /** Throws with an itemized report when any material's baseColorTexture is a normal map. */ export declare function assertBaseColorIsAlbedo(document: Document, label?: string): Promise; /** Convenience for callers that hold GLB bytes rather than a Document. */ export declare function assertGlbBaseColorIsAlbedo(glb: Uint8Array, label?: string): Promise; /** * Refuse (throw) when a character-surface GLB binds a tangent-space normal map as its base colour. Shared by the * real publish and `--dry-run`, so the gate that is run before paying the fee is the same one that runs at it. */ export declare function assertPublishBaseColor(opts: { kind: string; mesh?: string; }, meshBytes: Uint8Array | null | undefined): Promise;