Bloom Debugging Guide¶
This document describes the specialized debug mode for the Bloom post-processing effect.
Overview¶
The Bloom effect is constructed through multiple stages (Prefilter, Downsample chain, Upsample chain). The debug mode allows you to visualize these intermediate buffers to verify the luminance thresholding and the blur distribution.
Controls¶
- SHIFT + 'B': Cycles through the construction stages.
- Final Map: The final reconstructed bloom texture (Level 0).
- Prefilter: The result of the high-pass filter.
- Downsample: Visualization of a specific level in the downsampling chain.
- Upsample: Visualization of the progressive blending.
- ALT + 'B': Cycles through Mip Levels (0 to 4).
- In Downsample mode: Shows the output of each downscaling pass.
- In Upsample mode: Shows the result of the blending at different resolutions.
Implementation Details¶
Rendering Pipeline¶
When POSTFX_BLOOM_DEBUG is active in the active_effects bitmask:
postprocess.cbuilds anEffectContext(source texture, viewport dimensions) and callsfx_bloom_render(BloomFX*, BloomParams*, EffectContext*).fx_bloom_renderexecutes only up to the requesteddebug_step.- The pipeline uses
goto end_bloomto bypass unnecessary work. - The
postprocess.fragshader detects the debug flag and outputs the sampledbloomTexturedirectly, bypassing other effects (Film Grain, Vignette, etc.) for a clean visualization.
Note: Since the EffectContext decoupling,
fx_bloom.cno longer includespostprocess.h. Bloom receives only what it needs viaEffectContext+BloomParams.
UI Integration¶
The current state is displayed in the Status Overlay (toggle with F1):
Bloom Debug: [Stage] | Mip: [N]