/** * MeshletLODBuilder — Nanite-style hierarchical meshlet LOD generation * * Builds a DAG of meshlet LOD levels: * LOD0: meshlets from the original high-poly mesh * LOD1+: group meshlets, merge triangles, simplify, re-meshletize * * Each meshlet tracks its parent meshlets so the runtime can stream * and cull at the appropriate granularity for any screen size. * * @see HS-5 — Meshlet cluster generator directive */ import type { MeshData } from './LODGenerator'; import { Meshlet, type MeshletGeneratorOptions } from './MeshletGenerator'; /** A meshlet at a specific LOD level with parent-child links */ export interface HierarchicalMeshlet extends Meshlet { /** LOD level (0 = highest detail) */ lodLevel: number; /** IDs of child meshlets that were merged to create this one */ children: number[]; /** IDs of parent meshlets this meshlet contributes to */ parents: number[]; /** Global meshlet ID across all LOD levels */ globalId: number; } /** One level in the meshlet LOD hierarchy */ export interface MeshletLODLevel { /** LOD level index */ level: number; /** Meshlets at this level */ meshlets: HierarchicalMeshlet[]; /** Total triangles at this level */ totalTriangles: number; /** Total unique vertices at this level */ totalVertices: number; } /** Complete hierarchical meshlet result */ export interface MeshletHierarchyResult { /** LOD levels from finest to coarsest */ levels: MeshletLODLevel[]; /** Total meshlets across all levels */ totalMeshlets: number; /** Source triangle count */ sourceTriangles: number; /** Generation time in ms */ generationTimeMs: number; /** Reduction ratios per level */ reductionRatios: number[]; } /** Options for hierarchical meshlet generation */ export interface MeshletHierarchyOptions { /** Meshlet generation options */ meshletOptions?: Partial; /** Target number of meshlets to group for simplification (default: 4) */ groupSize: number; /** Number of LOD levels to generate (default: 3) */ levelCount: number; /** Triangle reduction ratio per level (default: 0.5) */ reductionRatio: number; /** Simplification algorithm */ simplificationAlgorithm: 'quadricError' | 'edgeCollapse' | 'vertexClustering'; } export declare const DEFAULT_HIERARCHY_OPTIONS: MeshletHierarchyOptions; export declare class MeshletLODBuilder { private options; constructor(options?: Partial); /** * Build a hierarchical meshlet LOD structure from a mesh. * * Algorithm: * 1. Generate LOD0 meshlets from the original mesh * 2. For each subsequent level: * a. Group meshlets from the previous level * b. Merge their triangles into a sub-mesh * c. Simplify the sub-mesh * d. Re-meshletize the simplified mesh * e. Link parent-child relationships */ build(mesh: MeshData): MeshletHierarchyResult; /** Get current options */ getOptions(): MeshletHierarchyOptions; } export declare function createMeshletLODBuilder(options?: Partial): MeshletLODBuilder; /** Convenience: build hierarchy in one call */ export declare function buildMeshletHierarchy(mesh: MeshData, options?: Partial): MeshletHierarchyResult; //# sourceMappingURL=MeshletLODBuilder.d.ts.map