PostProcessPass
PostProcessPass is the final image-space pass. It reads the composited scene_color attachment and applies a chain of full-screen subpasses - HDR tone mapping, bloom, FXAA, and vignette - before writing to the output framebuffer presented to the window.
Render Graph Role
| Attribute | Value |
|---|---|
| Group | VFX |
| Reads | scene_color, mesh_context, mesh_collector_storage |
| Writes | output (window framebuffer) |
| Cullable | Yes |
Subpasses
Subpasses run sequentially as ping-pong blit operations over internal transient textures. Each subpass can be toggled independently.
HDR Tone Mapping
Converts the linear HDR scene_color (RGBA16F) to LDR for display using the ACES filmic tone curve. Exposure is controlled by a scalar uniform.
Bloom
A two-pass bloom: a threshold extract followed by a dual Kawase blur. The blurred result is additively blended back onto the tone-mapped image. Configurable threshold and intensity.
FXAA
Fast Approximate Anti-Aliasing runs on the LDR image after tone mapping. It detects edges via luminance contrast and blends neighbour samples to smooth them.
Vignette
Applies a radial darkening from the center outward. Radius and strength are configurable.
Configuration
Subpasses are configured on the pass before the graph is compiled:
auto pp = create_scope<PostProcessPass>();
pp->hdr.exposure = 1.2f;
pp->bloom.threshold = 0.8f;
pp->bloom.intensity = 0.4f;
pp->bloom.enabled = true;
pp->fxaa.enabled = true;
pp->vignette.strength = 0.35f;
pp->vignette.enabled = true;
builder.add_pass(std::move(pp))
.read(scene_color)
.write(output)
.end();Custom Effects
Additional image-space effects can be injected by subclassing PostProcessSubpass and registering it with the pass:
pp->add_subpass(create_scope<MyCustomEffect>());Custom subpasses run after the built-in chain in registration order.