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

    Module scene/lod-blend

    Pure, dependency-free opacity math for the two orthogonal LOD anti-popping mechanisms, kept together (and THREE/camera-free) so both are unit-testable over plain numbers, like lod-freshness.ts / lod-display-gate.ts.

    The two mechanisms act on independent axes and compose by multiplying their opacity factors:

    1. Coverage cross-fade (distance axis) — coverageBlendPlan. As the camera zooms across a kind=lod boundary, blend the two adjacent levels' opacity instead of a hard object.visible swap. Driven ENTIRELY by the group's selector metric (projected size); which level to show is a function of distance (coverage_fraction). Brightness across the switch is preserved by the levels' build-time mass conservation (both integrate to the same DC).

    2. Streaming brightness compensation (time axis) — energyCompensation. As a single level's additive ladder streams in over time, its rendered energy climbs from e(k)·E toward E (additive/luminous compositing sums energy; the ladder commits highest-energy splats first), which reads as a brightening pop. Scaling opacity by 1/e(k) — opacity is a linear multiplier on summed energy in additive/luminous, and on optical depth τ in volumetric — holds the total near E throughout. This is a self-energy heuristic rather than the exact conservation law used by mechanism 1: e(k) is quadratic in amplitude while additive brightness is linear, and the approximation becomes exact only when the leaf is complete.

    Both mechanisms apply to the modes in BLENDABLE_MODES (scene/lod-fade.ts) — additive / luminous / volumetric; see that set's doc for the per-mode exactness argument and the volumetric caveat.

    CoverageBlend
    smoothstep
    coverageBlendPlan
    energyCompensation