Skip to main content

Function: createGaussianBlurEcsSystem()

createGaussianBlurEcsSystem(renderContext): EcsSystem<[CameraEcsComponent, GaussianBlurEcsComponent], void, void>

Defined in: rendering/systems/gaussian-blur-system.ts:40

Creates a two-pass separable Gaussian blur post-processing system.

For each camera with both a renderTarget and a GaussianBlurEcsComponent, blurs that target's contents in place: a horizontal pass renders into an internal scratch buffer, then a vertical pass reads that scratch buffer and renders the result back into the camera's renderTarget. Cameras without a renderTarget, or without a GaussianBlurEcsComponent (attach one with addGaussianBlurComponent), are left untouched.

Must be registered after the render system (so there's a scene to blur) and before the present system (so the blurred result gets drawn to the canvas).

Parameters

renderContext

RenderContext

The rendering context

Returns

EcsSystem<[CameraEcsComponent, GaussianBlurEcsComponent], void, void>

The Gaussian blur ECS system