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.
Clamp a
[0, 1]appearance fraction, supplyingfallbackwhen absent or unusable.ambientandalphaCutoffare both genuine fractions, not gains:ambientis the shade floor a face-away fragment keeps, andalphaCutoffis compared against a coverage that is itself in[0, 1]. Values outside the range are not merely odd, they are meaningless —ambient = 1e9multiplies the surface to white andalphaCutoff = 1e9discards 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
fallbackrather than clamping, matching the sibling shaders' sanitizer policy — corruption resolves to the documented default, loudly, instead of to a range boundary that looks deliberate.