Skip to main content

Module lut_grade

Module lut_grade 

Source
Expand description

Color Grading LUT — 3D look-up table generation, blending, and GPU upload.

Generates a 3D LUT from color grade parameters and applies it as a post-processing pass. The LUT transforms input RGB → output RGB in a single texture lookup, enabling complex color transformations at zero per-pixel math cost.

§Sizes

  • 16³ = 4,096 entries × 3 channels = 12,288 bytes (fast, low quality)
  • 32³ = 32,768 entries × 3 channels = 98,304 bytes (high quality)

§Game state LUTs

Each game state has a pre-baked LUT. When state changes, we smoothly blend between the old and new LUT over a configurable duration.

Structs§

GameStateLuts
Pre-built LUT presets for each game state.
Lut3D
A 3D color look-up table.
LutBlendDurations
Standard blend durations for LUT transitions between game states.
LutBlender
Smoothly interpolates between LUTs when game state changes.

Constants§

LUT_APPLY_FRAG
Fragment shader that applies a 3D LUT to the scene color. The LUT is stored as a 3D texture (GL_TEXTURE_3D).