Converts between a display [min, max] window and the shader's
intensity (gain) / offset uniforms. These helpers pull in no THREE and no
ui/ imports, and live in the rendering layer so both rendering/ and
ui/layers/ can import them without violating the module layer order
(rendering/ must never import from the higher ui/ layer). The one
import — _shared/scalar-range — is itself in that same dependency-free
class, and is here so isRemappableRange collapses at exactly the floor the
MATERIAL side (computeScalarRangeUniforms) collapses at. It is not a
file-wide unification: computeUniforms and computeDisplayRange below
still spell their own 1e-10 literals, and deliberately so — the latter's
is a threshold on an INTENSITY (a gain), a different quantity that merely
happens to share the value.
Pure display-window ↔ shader-uniform math.
Converts between a display
[min, max]window and the shader's intensity (gain) / offset uniforms. These helpers pull in no THREE and noui/imports, and live in the rendering layer so bothrendering/andui/layers/can import them without violating the module layer order (rendering/must never import from the higherui/layer). The one import —_shared/scalar-range— is itself in that same dependency-free class, and is here soisRemappableRangecollapses at exactly the floor the MATERIAL side (computeScalarRangeUniforms) collapses at. It is not a file-wide unification:computeUniformsandcomputeDisplayRangebelow still spell their own1e-10literals, and deliberately so — the latter's is a threshold on an INTENSITY (a gain), a different quantity that merely happens to share the value.