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

    Function applyColorAdjustments

    • Push gamma + the display-range adjustment to a leaf material, routed by whether it renders through a colormap LUT:

      • Colormap (LUT) mode: the display range defines the value window mapped into the LUT (uScalarMin/uScalarScale) and gamma warps that value before the lookup — both operate on the scalar, not the color. The composed display window is recovered from the gain/offset pair and pushed via updateScalarRange. The shader does NOT bypass the color GOG (it always multiplies vColor * uIntensity + uOffset post-LUT), so we actively RESET it to identity (updateIntensity(1)/updateOffset(0)) here — otherwise the authored gain would double-apply, both shaping the LUT window and multiplying the mapped color (#936).
      • Direct-color mode: GOG operates on the color (intensity/offset).

      Gamma is pushed in both modes (the shader applies it pre-LUT in colormap mode, on the color otherwise). Opacity and blending are handled by the caller. See the material shaders' USE_COLORMAP path.

      scalarWindow, when supplied, REPLACES the window this function would otherwise recover from intensity/offset — and only on the colormap route, which is the only one that has a scalar window at all. layer-apply.ts uses it to hand each leaf the layer's window re-expressed in that leaf's OWN data range (remapWindowToLeafRange), so a kind=lod / kind=partition layer stops rendering every level on the finest level's window (#1753). The gain/offset pair still drives the direct-color branch and the #936 identity reset, so a caller that passes nothing gets exactly the previous behaviour.

      Applied by layer-apply.ts when committing a layer's effective appearance.

      Parameters

      • mat: LuxarMaterial
      • gamma: number
      • intensity: number
      • offset: number
      • OptionalscalarWindow: { min: number; max: number }

      Returns void