Table of Contents

Separable Effects

Note

This is an implementation detail relevant when using separable shaders directly, rather than through PostProcess components or RenderFeatures.

An effect that samples a square neighborhood—such as a box blur—is separable if it can be computed by running two one-dimensional passes instead of a full two-dimensional pass. The idea is simple:

  • First pass: sample only horizontally.
  • Second pass: sample only vertically.

This approach reduces the cost from quadratic (sampling a 2D kernel) to linear in the kernel size, which is a major performance win.

Some effects are implemented with this two-pass scheme even when they are not strictly separable; in many cases the visual results are still more than good enough.

The general way to call these filters are the same, so the C# classes that wrap these effects extend from base classes that implement thee shared functionality.

In the built-in pipeline, this is SeparableNamedShaderPostProcess, and for URP it is SeparableRenderFeature .