Luxar Viewer API Documentation - v2026.9.22
    Preparing search index...
    • Clamp a [0, 1] appearance fraction, supplying fallback when absent or unusable.

      ambient and alphaCutoff are both genuine fractions, not gains: ambient is the shade floor a face-away fragment keeps, and alphaCutoff is compared against a coverage that is itself in [0, 1]. Values outside the range are not merely odd, they are meaningless — ambient = 1e9 multiplies the surface to white and alphaCutoff = 1e9 discards every fragment, i.e. the mesh disappears with no diagnostic. Both are reachable: add_mesh(**attrs) writes arbitrary attrs to zarr, so these arrive from authored (or hand-crafted) metadata rather than from code.

      NaN/Inf route to fallback rather than clamping, matching the sibling shaders' sanitizer policy — corruption resolves to the documented default, loudly, instead of to a range boundary that looks deliberate.

      Parameters

      • value: number | undefined
      • fallback: number

      Returns number