/** * 12-byte quantized vertices (issue #1682, phase 6). * * Layout (stride 12, matches the pipeline's quantized vertex state): * @0 uint16x4 qx, qy, qz, packedOct (WGSL reads vec4) * @8 uint32 entityId (same lane semantics as the 28B path) * * Positions quantize onto a GLOBAL LATTICE with step 2^-10 m (~0.98 mm), * each batch storing a lattice-ALIGNED `quantMin` (a multiple of the step in * the shared batch-origin-relative frame). This is what preserves the * renderer's coincidence guarantee (see mergeGeometry's shared-origin note): * a world point shared by two batches quantizes to the same lattice node in * both, and the shader's `quantMin + q * step` is BIT-EXACT in f32 — * every term is (integer)·2^-10 with the integer < 2^24 — so coincident * surfaces stay coincident and no seam z-fighting is introduced. * * Normals use octahedral encoding (2×u8 packed into the 4th u16): ~1.4° * worst-case error, invisible for BIM flat shading. The per-vertex entityId * lane (picking id + colour salt) is carried unchanged. * * A batch whose extent exceeds `MAX_QUANT_EXTENT` (u16 range × step ≈ 64 m) * cannot quantize and stays on the 28-byte f32 path — the caller checks * `quantizeInterleaved`'s null return. */ /** Lattice step: 2^-10 m. Power of two => exact f32 dequantization. */ export declare const QUANT_STEP: number; /** Max quantizable extent per axis (u16 range × step). */ export declare const MAX_QUANT_EXTENT: number; export declare const QUANT_BYTES_PER_VERTEX = 12; export interface QuantizedVertexData { /** Interleaved 12-byte records (uint16x4 + uint32). */ vertexData: ArrayBuffer; /** Lattice-aligned quantization origin (batch-origin-relative frame). */ quantMin: [number, number, number]; /** Lattice step (constant, exported for the uniform write). */ step: number; } /** Octahedral-encode a unit normal into two bytes (0..255 each). */ export declare function octEncode(nx: number, ny: number, nz: number): [number, number]; /** Decode (for tests/CPU parity with the WGSL decode). */ export declare function octDecode(bx: number, by: number): [number, number, number]; /** * Quantize a 28-byte interleaved batch vertex buffer (pos f32x3 + normal * f32x3 + entityId u32, `strideFloats` = 7) into the 12-byte layout. * Returns null when any axis extent exceeds the u16 lattice range — the * caller keeps the f32 buffer then. */ export declare function quantizeInterleaved(vertexData: Float32Array, strideFloats: number): QuantizedVertexData | null; //# sourceMappingURL=quantize.d.ts.map