PostprocessingSyncSystem
Builds and manages a THREE.js EffectComposer pipeline from the Postprocessing component's state, enabling full-screen visual effects in the rendered scene.
Overview
PostprocessingSyncSystem runs every frame and is responsible for:
- Building an
EffectComposerwith aRenderPassbase and adding post-process passes derived from the enabled effects inPostprocessing. - Rebuilding the composer pipeline when the effect configuration changes (detected by signature).
- Handing off the composer to
RenderSystemviascene.userData.ecsPostprocessingComposerso the render pass uses it instead of the defaultrenderer.render(). - Disposing old composers and passes when the configuration changes or the component is removed.
Queried components
| Component | Access |
|---|---|
Postprocessing | Read (effects array and each effect's enabled/parameter state) |
Supported effects
| Effect | THREE.js pass |
|---|---|
bloom | UnrealBloomPass |
dotScreen | DotScreenPass |
glitch | GlitchPass |
film | FilmPass |
bokeh | BokehPass |
ssao | SSAOPass |
hueSaturation | ShaderPass (HueSaturationShader) |
sepia | ShaderPass (SepiaShader) |
vignette | ShaderPass (VignetteShader) |
Behavior notes
- Composer handoff — when the composer is active,
scene.userData.ecsPostprocessingComposerActiveis set totrueandscene.userData.ecsPostprocessingComposerholds the composer reference.RenderSystemchecks this flag and delegates rendering to the composer instead of callingrenderer.render()directly. - Signature-based rebuild — the full effect configuration is serialized each frame. The composer is only rebuilt when the signature changes, so parameter tweaks during runtime (e.g. adjusting bloom strength from the inspector) are applied efficiently.
- Cleanup — when the
Postprocessingcomponent is removed from the scene, or when the composer is rebuilt, all existing passes are disposed and the composer is torn down.
API reference
- Class:
Postprocessing - Source:
core/systems/PostprocessingSyncSystem.ts

