Skip to main content

createBlurPasses

Callable


  • Separable 9-tap gaussian blur: a horizontal pass at scale resolution followed by a vertical pass that linearly upsamples back to the destination resolution.

    const material = new ex.Material({
      graphicsContext,
      passes: createBlurPasses({ graphicsContext }),
      padding: 8 // give the blur room so it is not clipped to the graphic
    });
    
    // or fullscreen
    game.graphicsContext.addPostProcessor(
      new ex.ShaderPipelinePostProcessor({ passes: createBlurPasses({ graphicsContext }) })
    );

    Parameters

    Returns ShaderPass[]