Post-Processing Effects
Filament provides a comprehensive suite of post-processing effects that can dramatically enhance the visual quality of your rendered scenes.Bloom
Bloom creates a glow effect around bright areas, simulating camera lens artifacts and light scattering.Basic Bloom Configuration
Bloom with Dirt Texture
Lens dirt textures add realistic camera imperfections:samples/material_sandbox.cpp:345
The dirt texture should be a grayscale image representing lens smudges and dust that scatter light.
Interactive Bloom Controls
samples/material_sandbox.cpp:723-727
Depth of Field (DOF)
DOF simulates camera focus, blurring objects based on their distance from the focal plane.DOF Setup
DOF is configured through the View settings and controlled via ViewerGui:samples/gltf_viewer.cpp:1130
Screenshot Description: A scene where the foreground object is in sharp focus while the background gradually blurs, creating a shallow depth of field effect similar to a DSLR camera with a wide aperture.
DOF Parameters
- Focus Distance: Distance to the plane of sharp focus
- Blur Scale: Controls the amount of blur (similar to aperture size)
- Max CoC Radius: Maximum circle of confusion in pixels
Tone Mapping & Color Grading
Tone mapping converts HDR rendering output to displayable LDR range, while color grading adjusts the final look.Color Grading Options
Tone Mapping Operators
Filament supports multiple tone mapping algorithms:- ACES: Academy Color Encoding System (film-like, recommended)
- Filmic: Alternative filmic curve
- Linear: No tone mapping (for LDR content)
- Reinhard: Classic tone mapping operator
Advanced Color Grading
Screen Space Ambient Occlusion (SSAO)
SSAO adds contact shadows and depth to scenes by darkening occluded areas.SSAO Configuration
samples/material_sandbox.cpp:621-649
SSAO Quality Levels
- LOW: Fast, good for mobile
- MEDIUM: Balanced quality/performance
- HIGH: Better quality, more samples
- ULTRA: Highest quality, desktop only
Bent Normals for Specular AO
samples/material_sandbox.cpp:634
Bent normals improve specular reflections by considering occlusion, making reflections more realistic.
Screen Space Cone Tracing (SSCT)
SSCT adds directional ambient shadows from light sources:samples/material_sandbox.cpp:651-664
Screenshot Description: A scene with directional lighting showing soft contact shadows beneath objects, created by SSCT tracing light occlusion in screen space.
Vignette Effect
Vignette darkens the edges of the frame, drawing focus to the center:Temporal Anti-Aliasing (TAA)
TAA reduces aliasing artifacts using temporal sampling:Multi-Sample Anti-Aliasing (MSAA)
MSAA provides hardware anti-aliasing:Post-Processing Pipeline Order
Filament applies effects in this order:- SSAO computation
- Lighting and materials
- SSR (if enabled)
- TAA (if enabled)
- DOF
- Bloom
- Color grading and tone mapping
- Vignette
- Dithering
- FXAA (if enabled)
Disabling Post-Processing
For maximum performance or stylized rendering:samples/animation.cpp:76, samples/image_viewer.cpp:294-295
This disables all post-processing, including tone mapping. Useful for UI rendering or effects composition.
Performance Considerations
Effect Performance Impact (relative)
| Effect | Mobile | Desktop |
|---|---|---|
| Bloom | Medium | Low |
| DOF | High | Medium |
| SSAO | High | Medium |
| TAA | Low | Low |
| MSAA 4x | High | Medium |
| Color Grading | Low | Low |
Optimization Tips
- Use TAA instead of MSAA for better performance
- Lower SSAO quality on mobile devices
- Reduce bloom iterations for faster performance
- Use lower DOF quality or disable on mobile
- Combine effects wisely - too many can overwhelm the scene
Best Practices
- Subtle is Better: Keep effect strengths low for realistic results
- Test on Target Hardware: Mobile devices may struggle with multiple effects
- Artistic Direction: Match effects to your game’s visual style
- Dynamic Adjustment: Allow players to toggle effects for performance
- HDR Pipeline: Always render in HDR and tone map at the end
Related Samples
material_sandbox.cpp- Interactive post-processing controlsgltf_viewer.cpp- Full post-processing pipeline with GUIimage_viewer.cpp- Minimal post-processing for image display