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.
Push gamma + the display-range adjustment to a leaf material, routed by whether it renders through a colormap 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 viaupdateScalarRange. The shader does NOT bypass the color GOG (it always multipliesvColor * uIntensity + uOffsetpost-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).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_COLORMAPpath.scalarWindow, when supplied, REPLACES the window this function would otherwise recover fromintensity/offset— and only on the colormap route, which is the only one that has a scalar window at all.layer-apply.tsuses it to hand each leaf the layer's window re-expressed in that leaf's OWN data range (remapWindowToLeafRange), so akind=lod/kind=partitionlayer 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.tswhen committing a layer's effective appearance.