Post-Effect
Post-effect is a technique for adding visual effects to the final 2D image after the 3D scene rendering is complete. RedGPU's post-processing system provides a dualized interface for configuration convenience and execution efficiency.
1. System Structure: Control and Execution
Users control post-processing through two managers depending on their purpose, but the actual operations are executed sequentially within a single pipeline supervised by the PostEffectManager.
- ToneMappingManager (
view.toneMappingManager): A dedicated window responsible for color transformation settings such as the basic hue, exposure, and contrast of the scene. - PostEffectManager (
view.postEffectManager): Responsible for adding or deleting general effects and the overall execution of the pipeline.
2. Rendering Pipeline Flow
All effects are processed in the following order. This sequence is fixed for graphics optimization and consistency of visual results.
- HDR Phase (Scene Components): The stage for assembling physical scene components, including
SkyAtmosphere,SSAO(Screen Space Ambient Occlusion), andSSR(Screen Space Reflections). - Exposure & Transition (Exposure and Tone Mapping Transition):
AutoExposurecalculation is performed.- The loop for User General Effects registered via
addEffect()is executed. - During this loop, Tone Mapping is performed immediately when the first LDR (Low Dynamic Range) effect is encountered. If not triggered during the loop, it is executed at the end of the loop.
- LDR Phase (Antialiasing): The final correction stage for the final image, where
FXAAorTAA(along withTAASharpen) is executed based on activation states.
[Live Demo]
Check out all effects in action in real-time on the RedGPU Official Examples Page.
3. Learning Guide
- General Effects: Adding various effects such as bloom, blur, and grayscale.
- Tone Mapping: Configuring basic scene color and exposure.
- Built-in Effects: Activating high-performance effects like SSAO and SSR.
- Antialiasing: Smoothing jagged edges.