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

    Class DensityGuard

    Owns the per-node keep ladder; driven by the tracker's onVisit hook.

    Index
    deps: DensityGuardDeps | null = null
    changed: boolean = false
    captureActive: boolean = false
    • Current keep on a mesh's material (1 when unthinned / no uniform).

      Parameters

      • mesh: Mesh

      Returns number

    • Suspend the guard for an offline capture (true) or resume it (false). While suspended every visited node is released to keep 1 — an export renders the whole node, whatever the view's density.

      Parameters

      • active: boolean

      Returns void

    • Tracker visit hook: re-derive this node's keep fraction from its fresh density record, apply a step change to material + brightness, and re-assert the uniform. Off-screen nodes hold their step (no churn on nodes nobody sees; they re-evaluate the frame they return).

      Parameters

      Returns void

    • Re-apply the brightness term when it changed. Keyed on (keep, blendability): a thinned node switching between a sum mode and normal keeps its keep but changes its term. An unthinned node (keep 1 before and after) is never touched.

      Parameters

      • mesh: Mesh
      • current: number
      • next: number
      • blendable: boolean
      • deps: DensityGuardDeps

      Returns void

    • The keep fraction for this frame: 1 while an offline capture runs or for a mode the guard never thins; the held step while off-screen; otherwise the hysteresis ladder.

      Parameters

      Returns number

    • Undo this node's thinning (guard turned off at runtime): keep back to 1, brightness recomputed without the density term, uniform cleared. A no-op on anything that is not a thinned data mesh.

      Parameters

      • obj: Object3D

      Returns void

    • True once since the last call if any node changed step (or drifted).

      Returns boolean