Skip to main content

Triangle Blur

Blend neighboring pixels with a linearly weighted pyramid kernel. triangleBlur uses separable horizontal and vertical passes to produce an inexpensive, visibly soft image treatment.

GitHub

At a Glance​

PropertyValue
ExporttriangleBlur
BackendsWebGPU and WebGL2
Render passesTwo separable fullscreen sampling passes
Additional inputsNone

Usage​

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

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

renderer.renderToScreen({
sourceTexture: sceneColorTexture,
uniforms: {triangleBlur: {radius: 14}}
});

Parameters​

ParameterDefaultSuggested rangeDescription
radius200 to 100Width of the triangular blur kernel in source-image pixels.

The descriptor owns its horizontal and vertical direction uniforms. A radius of zero suppresses the visible blur but does not remove the two configured fullscreen passes.

Composition and Cost​

The pass performs two separable draws and requires no scene depth or persistent history. Its triangular weights differ from the smoother bell-shaped Gaussian Blur kernel; choose between them based on the desired reconstruction profile rather than pass count alone.

  • Gaussian Blur produces a smoother photographic weight falloff.
  • Tilt Shift varies blur strength around a selected focal line.
  • Zoom Blur samples radially toward an adjustable focal center.