GLSL_DENSITY_ALPHA:"\nuniform float uDensityAlphaExp;\nfloat luxarDensityAlpha(float a) {\n if (!(uDensityAlphaExp > 1.0)) return a;\n return 1.0 - pow(max(1.0 - a, 0.0), uDensityAlphaExp);\n}\n" = ...
Fragment-stage companion of the density thinning above, for alpha-over
(normal) nodes: the density guard drops a 1 − keep fraction of the
elements and sets uDensityAlphaExp = 1/keep, so a survivor's alpha
1 − (1 − α)^(1/keep) makes keep·N survivors transmit what N did. At
an exponent ≤ 1 — every unthinned node, and a material that never set the
uniform (reads 0) — the helper returns a untouched, so such a node draws
bit-identically. Sum-projected modes compensate through opacity instead
(applyLodFade) and always carry the identity exponent.
Fragment-stage companion of the density thinning above, for alpha-over (
normal) nodes: the density guard drops a1 − keepfraction of the elements and setsuDensityAlphaExp = 1/keep, so a survivor's alpha1 − (1 − α)^(1/keep)makeskeep·Nsurvivors transmit whatNdid. At an exponent ≤ 1 — every unthinned node, and a material that never set the uniform (reads 0) — the helper returnsauntouched, so such a node draws bit-identically. Sum-projected modes compensate through opacity instead (applyLodFade) and always carry the identity exponent.