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

    Module rendering/materials/_shared/scalar-range

    Single source for the colormap scalar-range → uniform mapping shared by all six materials (point/line/gsplat × GLSL/TSL).

    The shaders sample the LUT at t = clamp((scalar - uScalarMin) * uScalarScale, 0, 1). Historically each material computed uScalarScale = 1/max(1e-10, max-min) inline (12 copies), which sent a DEGENERATE range (min === max — e.g. a constant scalar attribute, or a producer-stamped [1, 1] scalar_data_range) to t = 0: every element rendered at the very bottom of the LUT (black, in gray). The identity for a constant scalar is the MIDPOINT: with scalarMin = min - 0.5 and scalarScale = 1, a constant scalar === min maps to t = 0.5 — visible and neutral, mirroring the degenerate display-range identity fix (#631).

    ScalarRangeUniforms
    DEGENERATE_SCALAR_RANGE_EPS
    computeScalarRangeUniforms
    scalarRangeUniformEntries