Post effects
Generated from engine/render/post_effect.h at aceb130. The text under each declaration is the header's own comment, word for word. About the reference says how these pages are made.
Audience: game code.
#include "engine/render/post_effect.h" · namespace labrador
The post stage's materials and their values (docs/effects.md#5). A chain is a list of PostEffect, set on the Renderer outside a frame; each effect's values are set with Renderer::set_post_values.
enum class PostEffect
Section titled “enum class PostEffect”{ identity,
crt,};identity-
The scene, texel for texel: a frame through it is the frame without it, byte for byte.
crt-
A CRT monitor: curvature, scanlines that widen with brightness, an aperture-grille mask, a vignette and colour fringing, inside one screen region. Its values come from crt_values.
post_effect_count
Section titled “post_effect_count”inline constexpr int post_effect_count = 2;The number of PostEffect values, for a table indexed by one.
struct PostValues
Section titled “struct PostValues”The frame's material_values (engine/render/post_frame.hlsli) as the caller fills them: eight groups of four floats, read by a material as material_value(0) to material_value(7).
values
Section titled “values”std::array<float, 32> values{};struct CrtSettings
Section titled “struct CrtSettings”Every strength defaults to zero, and zero turns that term off; with every term off the CRT draws the scene unchanged.
screen
Section titled “screen”Back-buffer pixels. Outside it, pixels pass through untouched.
curvature
Section titled “curvature”float curvature = 0.0f;0 is flat. The picture's corners leave the tube as it grows.
scanline_count
Section titled “scanline_count”float scanline_count = 120.0f;Scanlines across the screen's height, so their number stays fixed as the screen grows or shrinks. Spaced evenly at the centre; curvature packs them closer toward the top and bottom, by up to 1 + 4 * curvature at the corners.
scanline_strength
Section titled “scanline_strength”float scanline_strength = 0.0f;0..1. Dark rows thin more than bright ones.
mask_strength
Section titled “mask_strength”float mask_strength = 0.0f;0..1. An aperture grille three output pixels wide.
vignette
Section titled “vignette”float vignette = 0.0f;0..1. Darker toward the curved edge.
aberration
Section titled “aberration”float aberration = 0.0f;Back-buffer pixels of red/blue split at the screen's edge.
brightness
Section titled “brightness”float brightness = 1.0f;A gain restoring what the mask and the beam take away; 1 is none.
min_pixels_per_scanline
Section titled “min_pixels_per_scanline”inline constexpr float min_pixels_per_scanline = 4.0f;The fewest output pixels one scanline may cover. Fewer alias into moire bands once curvature bends the rows.
crt_values
Section titled “crt_values”Packs settings into the CRT material's layout, dividing the screen by the back-buffer size. Throws std::invalid_argument for a NaN or infinite value, a negative value, a 0..1 strength above 1, a screen with no area, a back buffer with no area, or, with scanlines on, a count giving fewer than min_pixels_per_scanline output pixels a line at the screen's centre.
crt_values_are_neutral
Section titled “crt_values_are_neutral”Whether values, in crt_values' layout, turn every CRT term off - or have no screen, as an effect whose values were never set has none. A backend draws such a CRT as identity, which is exact where resampling through the CRT's arithmetic is not.
crt_source_position
Section titled “crt_source_position” const Vector2F& output_pixel);Where on the flat picture the CRT samples for the point output_pixel, in back-buffer pixels: the material's curvature, on the CPU. A point outside the screen, or any point when the screen has no area, is its own answer. Empty for a point inside the screen whose curved position falls past the tube's edge, which the material draws black. A pointer over the curved picture is mapped through this to find what it is over.
Related types
Section titled “Related types”Named in the public declarations above: RectangleF, Vector2F.
In the samples and tests
Section titled “In the samples and tests”The files that include this header directly. A file can also reach it through another header.
tests/render/d3d12/presentation_diagnostics_tests.cpptests/render/null_tests.cpp,post_effect_tests.cpp,post_pixel_tests.cpp
Explained in
Section titled “Explained in”Development documentation (unreleased). Built from Labrador aceb130 of 2026-11-20.