Luxar Viewer API Documentation - v2026.9.22
    Preparing search index...

    Module data/scene-loader/progressive/refinement

    Generic progressive-LOD refinement loop.

    Factored from data/gsplats/lod-refinement.ts so all four geometry types (Points, Lines, GSplats, Mesh) can drive the same requestAnimationFrame() yield + cancellable-via-queue contract with their own typed loader / processor / commit closures.

    Per-frame contract:

    1. Yield via requestAnimationFrame (synchronous in test envs).
    2. Check the view-state queue for a pending update from the user. If pending → hand off to retriggerUpdate and return.
    3. For each loader, call the user-supplied processLoader closure — which derives view-state, fetches the next LOD, processes, and commits.
    4. Call updateVisibleCountsInMonitor once per pass.
    5. If loaders still have more LODs and every one of them succeeded but none advanced, report the stalled rung(s), release the SceneLoader lock, and exit.
    6. Otherwise repeat until every loader finishes its ladder.
    RefinementFailureTracker
    ProgressiveRefinementProgress
    ProgressiveRefinementCtx
    MAX_CONSECUTIVE_REFINEMENT_FAILURES
    runProgressiveRefinement