Global Motion Blur
Motion blur via post processing allows you to blur the entire scene in one direction. You can chose include or exclude certain objects by assigning custom stencil values.
If you wish to make use this effect, you will need to enable the custom depth-stencill pass in your project settings.
Global motion blur
Content > CustomMotionBlur > GlobalMotionBlur, you will find the
Drag it into your scene, and you will see that it has immediate effect.
In the Details panel, you will find the settings for this effect.
Increase the strength, and notice that the entire scene gets blurrier.
Unlike the Linear Motion Blur cage, this effect does not weaken over distance.
Select an asset you would like to exclude from the effect. In the details panel, search for
depth, and enable
Render CustomDepth Pass. Set the
CustomDepth Stencil Value so a prefered value between 1-255.
Next, you can use the Custom Stencil view mode to see if your object is writing the correct value.
The forward direction of the actor determines the blur direction. Rotate it around to see how it affects the scene.
If you toggle
Invert Mask, only the marked objects get blurred.
Both the Linear and Circular blur cage inherit from the same blueprint. In both cases, their transform determine the influence area of the effect.
They have the following settings, which are set in the construction script:
Strength: determines the intensity of the effect.
Stencil Value: Sets the DepthStencil value. A number between 1-255.
Invert Mask: False: Only objects within the depth stencil mask are blurred. True: Everything except these objects is blurred.
Double Samples: By default, this effect used 6 samples to resolve the blur. In certain cases, usually with extreme values / contrast, banding can occur. You can double the samples to 12 to reduce these artifact.
Stack Index: You can use 8 passes of this effect in total. See Advanced Usage for more.
They also have the following setters.
You should use this when updating the variables in-game.
SetStrength: Sets the intensity of the effect.
Stacking global blurs
You can use multiple global motion blur actors in your scene, as long as their “Stack Index” is unique.
Unreal’s post process handles multiple identical post process materials by blending between the variables, rather than applying the effect multiple times. This is why the Resources folder contains multiple copies of the exact same material - to fool UE into applying the effect multiple times.
This effect is a custom post process material under the hood. The blueprint is a post process volume, with the relevant material applied. If you wish to have more control over the application of this effect, you can always apply it manually.
In order to minimize the performance impact, this motion blur is resolved in as few samples as possible, limiting the ammount of instructions and texture lookups. However, as with everything in real-time rendering, it should be used in moderation. Especially the Global Motion Blur, as it applies to the entire screen.
This being a real-time effect, there are limits to what can be done while keeping the framerate acceptable. If you need super-fine quality, you can duplicate the blurprint, keep the settings intact, but change the Stack Index. This makes it so that the second effect uses the output of the first one. This results in the equivalent of 144 samples (if DoubleSamples is enabled) and should be noise-free.