PostprocessingSyncSystem
Builds and manages the post-processing chain from the Postprocessing component's state, enabling full-screen visual effects in the rendered scene. The chain comes from the world's render backend: an EffectComposer on WebGL, a TSL RenderPipeline with webgpuBackend.
Overview
PostprocessingSyncSystem runs every frame and is responsible for:
- Asking the backend (
world.getRenderBackend().createPostprocessing(...)) for a chain built from the enabled effects inPostprocessing. On WebGL that is anEffectComposerwith aRenderPassbase and one pass per effect. - Rebuilding the chain when the effect configuration changes (detected by signature), or updating it in place when the backend supports that (WebGPU does for parameter-only changes).
- 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
WebGL backend (the WebGPU mapping is on the WebGPU and TSL page):
| 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) |
chromAberration | ShaderPass (RGBShiftShader) |
pixelation | Pixelation ShaderPass (block sampling, sized in device pixels) |
smaa | SMAAPass, placed right before OutputPass |
toneMapping | No pass: sets renderer.toneMapping / toneMappingExposure, which OutputPass applies |
Pass order: render → dof → bloom → vignette → hueSaturation → sepia → noise → dotScreen → ssao → glitch → chromAberration → pixelation → smaa → OutputPass.
Behavior notes
- Composer handoff: when the composer is active,
scene.userData.ecsPostprocessingComposerActiveis set totrueandscene.userData.ecsPostprocessingComposerholds the chain (on WebGL, theEffectComposeritself).RenderSystemchecks this flag and delegates rendering to the chain instead of callingrenderer.render()directly.scene.userData.ecsPostprocessingholds the values it was built from. - Signature-based rebuild: the full effect configuration is serialized each frame and nothing happens while it is unchanged. On a change the WebGL backend rebuilds the composer; the WebGPU backend writes new parameters into its uniforms and rebuilds only when an effect is switched on or off.
- WebGPU without
webgpuBackend: the world warns once and builds no chain (tone mapping still applies through the renderer).EffectComposernever runs on aWebGPURenderer. - Tone mapping: the
toneMappingeffect (withpostEnabledon) uses ACES Filmic unlessEnvironment.values.lighting.toneMappingnames an operator, and itsexposureoverrides the environment's. Turning the effect off hands the renderer back to the environment's settings, or to its original values when there are none. - 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

