Skip to main content

Module bloom_pipeline

Module bloom_pipeline 

Source
Expand description

Proper Bloom Pipeline — multi-level downsample/upsample bloom with brightness threshold.

Only intentionally bright things glow. UI text (emission 0.0) never blooms. Damage numbers (emission 1.5), crits (emission 2.5), spells (emission 2.0+), boss auras (emission 1.0) all bloom at appropriate intensities.

§Pipeline

scene_emission_tex (from glyph fragment shader, attachment 1)
  └─ Threshold extract (luminance > threshold) ─▶ bright_tex (full res)
      ├─ Downsample ½  ─▶ mip[0] ── H blur ── V blur ─▶ blurred[0]
      ├─ Downsample ¼  ─▶ mip[1] ── H blur ── V blur ─▶ blurred[1]
      ├─ Downsample ⅛  ─▶ mip[2] ── H blur ── V blur ─▶ blurred[2]
      ├─ Downsample 1/16 ─▶ mip[3] ── H blur ── V blur ─▶ blurred[3]
      └─ Downsample 1/32 ─▶ mip[4] ── H blur ── V blur ─▶ blurred[4]
  Upsample chain: blurred[4] + blurred[3] + ... + blurred[0] ─▶ bloom_result
  Composite: scene_color + bloom_result × intensity ─▶ output

Structs§

BloomPipelineState
Describes the full multi-level bloom pipeline state for one frame.
BloomStats
Per-frame bloom statistics.
EmissionPresets
Standard emission values for different game element categories. These control which elements participate in bloom and how strongly.
ThemeBloom
Bloom intensity profiles per game theme.

Constants§

BLOOM_BLUR_FRAG
Separable Gaussian blur with variable sigma. Direction (1,0) for horizontal, (0,1) for vertical.
BLOOM_DOWNSAMPLE_FRAG
Downsample shader (box filter 2x2). Takes a texture and renders it at half resolution.
BLOOM_THRESHOLD_FRAG
Brightness threshold extraction shader.
BLOOM_UPSAMPLE_FRAG
Upsample shader (bilinear + additive blend). Combines the current mip level with the upsampled lower mip.