Post-Effect
The Post-Effect system applies screen-space lighting, color grading, lens effects, and anti-aliasing to the final output image via a compute-shader pipeline after the 3D scene's G-Buffer rendering is complete.
1. Control Interface
View3D provides two manager properties depending on the post-processing purpose, while actual pipeline execution and texture pooling (PostEffectTexturePool) are centrally managed by PostEffectManager.
view.postEffectManager(PostEffectManager): Manages built-in effects (useSSAO,useSSR) and user effect chains (addEffect,removeEffect), and executes the entire post-processing pipeline.view.toneMappingManager(ToneMappingManager): Controls the tone mapping algorithm (mode),contrast, andbrightnessthat map HDR data into the display output range (LDR).
2. Rendering Pipeline Execution Order
PostEffectManager executes post-processing in the following 3 phases to preserve physical accuracy and image quality:
- HDR Built-in & Temporal Phase
- Sequentially composites
SkyAtmosphere,SSAO, andSSRusing the scene's HDR color and G-Buffer (depth, normal, motion vector). - When
TAAis enabled, it performs motion-vector-based temporal accumulation in HDR space prior to tone mapping, followed by cameraAutoExposureluminance calculation.
- Sequentially composites
- User Effects & Smart Tone Mapping Transition Phase
- Iterates through the effect list registered via
view.postEffectManager.addEffect(). - HDR-based effects (
isLdr: false, such asOldBloom) run first in HDR space. As soon as the first LDR effect (isLdr: true) is encountered,ToneMappingManageris executed immediately to transition into LDR color space (if no LDR effects are present, tone mapping runs right after the loop).
- Iterates through the effect list registered via
- LDR Finalization Phase
3. Core Components
- General Effects: Build filter chains such as bloom, depth of field (DoF), blur, fog, and color adjustments via
addEffect(). - Tone Mapping: Map HDR scene colors and exposure into the LDR display range via
ToneMappingManager. - Built-in Effects: Activate G-Buffer-integrated
SSAOandSSReffects.
Related Examples
- SSAO (Screen Space Ambient Occlusion)
- SSR (Screen Space Reflection)
- Depth of Field (DoF)
- Bloom (OldBloom)