Skip to main content

Module hdr

Module hdr 

Source
Expand description

HDR Render Target — 16-bit float framebuffer with tone mapping and exposure control.

Changes the scene framebuffer from RGBA8 to RGBA16F, allowing color values above 1.0. Crits and spell effects can be 10x brighter than normal without clipping, creating dramatic contrast when tone mapped back to SDR for display.

§Tone mapping operators

  • Reinhard: Simple, preserves colors well. c / (1 + c)
  • ACES: Academy Color Encoding System filmic curve. Industry standard.
  • Uncharted2: John Hable’s filmic operator from Uncharted 2.

§Exposure control

  • Auto-exposure: Adapts based on scene average luminance (eye adaptation).
  • Manual: Fixed exposure value for specific moments (death, boss intro).

Structs§

AutoExposure
Tracks scene luminance and computes auto-exposure.
ExposurePresets
Exposure presets for specific game moments.
HdrParams
HDR rendering parameters.
HdrStats
Per-frame HDR rendering statistics.

Enums§

ExposureMode
Exposure control mode.
ToneMapOperator
Available tone mapping operators.

Constants§

HDR_TONEMAP_FRAG
HDR tone mapping + exposure fragment shader. Applied as the final post-processing pass before display.
LUMINANCE_FRAG
Luminance computation shader for auto-exposure. Computes log-average luminance of the scene.