Mega-shader: single-pass post-processing fragment shader.
Fuses chromatic lens distortion, detector noise, EOG, tone mapping,
and vignette into one fullscreen pass. Each effect is gated behind
an #ifdef USE_* define so a recompile is needed only when an
effect is toggled on/off — value tweaks just update uniforms.
Pre-stages owned by the host:
Bloom pyramid renders into uBloomTexture (see BloomChain).
The mega-shader samples bloom at the SAME (chromatic-aberrated)
UVs as the scene so bloom is effectively additively-blended into
the HDR buffer BEFORE chromatic lens distortion samples from it.
FXAA is a separate post-pass after the mega-shader, since edge
detection needs neighbor reads of the final LDR pixels.
Operation order:
Bloom additively mixed into the HDR scene (per-channel at
distorted UVs when lens distortion is on)
Lens distortion (sampling lookup)
Detector noise
EOG (Exposure-Offset-Gamma)
Tone mapping (mode-switched via LUXAR_TONE_MAPPING_MODE
shader-define; values are Luxar-internal IDs 1..6, NOT THREE's
enum values — see toneMappingModeDefine in the material file
for the mapping. NoToneMapping aliases to Linear so it
clamps to [0,1].)
Mega-shader: single-pass post-processing fragment shader.
Fuses chromatic lens distortion, detector noise, EOG, tone mapping, and vignette into one fullscreen pass. Each effect is gated behind an
#ifdef USE_*define so a recompile is needed only when an effect is toggled on/off — value tweaks just update uniforms.Pre-stages owned by the host:
uBloomTexture(see BloomChain). The mega-shader samples bloom at the SAME (chromatic-aberrated) UVs as the scene so bloom is effectively additively-blended into the HDR buffer BEFORE chromatic lens distortion samples from it.Operation order:
LUXAR_TONE_MAPPING_MODEshader-define; values are Luxar-internal IDs 1..6, NOT THREE's enum values — seetoneMappingModeDefinein the material file for the mapping.NoToneMappingaliases to Linear so it clamps to [0,1].)