Skip to main content

Zoom Blur

Pull image samples toward a chosen focal point to suggest rapid zoom, radial motion, or a stylized optical rush. zoomBlur preserves the selected center while increasingly stretching detail farther away.

GitHub

At a Glance

PropertyValue
ExportzoomBlur
BackendsWebGPU and WebGL2
Render passesOne sample-heavy fullscreen pass
Additional inputsNone

Usage

import {ShaderPassRenderer} from '@luma.gl/engine';
import {zoomBlur} from '@luma.gl/effects';

const renderer = new ShaderPassRenderer(device, {shaderPasses: [zoomBlur]});

renderer.renderToScreen({
sourceTexture: sceneColorTexture,
uniforms: {zoomBlur: {center: [0.5, 0.5], strength: 0.16}}
});

Parameters

ParameterDefaultSuggested rangeDescription
center[0.5, 0.5]Normalized image coordinatesFocal position toward which the sampling path converges.
strength0.30 to 1Radial sample displacement; larger values create longer streaks.

The pass animates naturally when the application changes the focal center or strength each frame. It does not require motion vectors and does not distinguish actual object movement.

Composition and Cost

Although zoom blur occupies one render pass, it samples multiple positions along each radial path and can be materially more expensive than a one-sample color adjustment. Use reduced effect resolution for large canvases, and prefer Motion Blur when physically meaningful per-pixel velocity is available.

  • Motion Blur follows scene-authored velocity and respects depth edges.
  • Swirl rotates image coordinates around a focal point.
  • Tilt Shift preserves a focused line rather than a single center.