RenderSystem
The final system in the update loop. Submits the frame to the WebGL renderer, delegating to an EffectComposer when postprocessing is active.
Overview
RenderSystem runs last in the world update loop and is responsible for:
- Calling
renderer.render(scene, camera)to produce the final frame. - Detecting whether
PostprocessingSyncSystemhas placed an activeEffectComposeronscene.userData.ecsPostprocessingComposer. - When a composer is active: resizing it to the current renderer element dimensions and calling
composer.render()instead of the default render path. - Invoking an optional
afterRendercallback after every frame (used by editor overlays or custom render hooks).
Behavior notes
- Composer precedence — the system checks
scene.userData.ecsPostprocessingComposerActiveeach frame. Iftrue, theEffectComposerpath is used; otherwise the standardrenderer.render()path is used. This coupling withPostprocessingSyncSystemmeans both systems must be present for postprocessing to work. - Dynamic resize — before calling
composer.render(), the system readsrenderer.domElement.clientWidth/Height(clamped to≥ 1) and updates the composer size to match. This ensures the effect pipeline stays correct after window resizes without an explicit resize event handler. - Ordering —
RenderSystemmust be registered last inWorld.setup. All scene mutations (transform sync, visibility, etc.) must have already run.
API reference
- Source:
core/systems/RenderSystem.ts

