User Scene Textures for Post Process Materials(5/5)
Adding the Post Process Materials to a Post Process Volume
The final step is to set up and add the post process materials to a post process volume in the scene to see the variable blur post process effect working.
- Add a Post Process Volume to your scene and scale it to encompass a large enough area to see the effect when applied. You can check the box for Infinite Extent (Unbound) to have the volume cover the entire world rather than just its bounding box.
- In the Details panel under Rendering Features, expand the Post Process Materials section.
- Click the Add (+) icon next to the Array to add a new Post Process Material element. Repeat this step until you have 7 array elements.
- Next to each of the array elements, click the dropdown and choose Asset Reference.
- Next to each of the array elements, click the dropdown and assign each of the Post Process Materials you created throughout this guide. They should be assigned in this order since they will be run in this order: HalfA
- HalfB
- HalfC
- QuarterA
- QuarterB
- QuarterC
- BlurApply
Your the Post Process Materials array should look like this now:
When applied to the post process volume, the effect can look like this, with an unblurred center, medium blurred middle, and heavier blurred outer edge.
| First Person Template | Third Person Template |
At first glance, it may be hard to see what parts of the screen have no blur, a medium blur, or heavy blur. You can use some material logic to visually inspect where blur is applied by following the directions in the Applying Color to Debug the Material Effect section of this page.
Applying Color to Debug the Material Effect
To make this variable blur effect more visible in the scene, you can apply some color modulation with a little bit of material logic. This will help identify the different levels of blur independently on the screen for their user scene texture inputs.
- Open the BlurApply material.
- On UserSceneTexture:HalfC pull off the Color output and add a Multiply node.
- Right-click in the graph and add a Constant4Vector and set a color for it.
- Connect the RGBA color pin to input B on the Multiply node.
- Connect the Multiply output to input B on the TripleBilinearLerp node.
- Repeat these steps for UserSceneTexture:QuarterC and connect its Multiply to input C on the TripleBilinearLerp node.
You should have something that looks similar to this:
This will result in material preview window looking similar to this:
Once you have this setup, you can use the Multiply node on the Alpha input of the TripleBilinearLerp to scale up the variable blur effect.
Below are some examples demonstrating this scaling factor in the material preview window:
| Debug Colors Alpha Multiply: 1.0 | Debug Colors Alpha Multiply: 1.5 | Debug Colors Alpha Multiply: 2.0 |
The Subtract node helps create a dead space in the center of the frame where there is no blurring at all. Start with a small value and incrementally increase to get a desired dead space.
Below are some examples with incremental increases to the Subtract value to have no blurring applied to the center of the frame.
| Debug Coloros Subtract: 0.0 (No Effect) | Debug Colors Subtract: 0.1 | Debug Colors Subtract: 0.25 |
When this material is applied to your Post Process Volume, you can use it to clearly see how the variable blur effect is applied in a game setting, like the ones below using the First Person and Third Person templates.
| First person Template using material debug colors. | Third Person Template using material debug colors. |
