This post process effect is based on custom HLSL code that is designed to achieve a soft outline effect in the most efficient way. This is achieved by leveraging temporal anti aliasing (TAA) which enables spreading out the calculations over multiple frames, significantly reducing the performance cost.
How to use
- Add a post process volume to your level and check the “Infinite Extent” tick box in the details panel
- Find the Post Process Materials section and add a new asset reference to the “Post Process Materials”
- Assign a material instance (Style) of the SoftOutline material to the asset reference
- Select meshes you wish to receive the outline and enable the “Render CustomDepth Pass” tick box
- You should now be able to see the outline on those meshes – if you need more information, check out the official documentation on post process materials
How to use multiple outline styles (supported from engine version 4.25):
- In the project settings set “Custom Depth-Stencil Pass” to “Enabled with Stencil”
- On the outline material instance enable “UseMultipleOutlines” and set “CustomDepth Stencil Value” on both the material instance and the meshes to the same value (values from 1-255 are valid)
- Add additional outline styles to the post process volume and match it with other meshes by assign a different stencil value to the material instance and the meshes
Technical Details
Performance
At at resolution of 1920×1080 on a NVIDIA GTX 980 (released in 2014) it only takes 0.3ms at 100% and 0.16ms at 75% resolution scaling, to render the outline effect on medium quality setting and 8 pixels in size.
You can also see approximate performance numbers for different settings in this video.
Scalability
In the default AutoQuality mode, which seeks to optimize sample counts at different outline sizes, the effect offers a quality parameter, which allows you to choose the quality/ performance trade-off that works best for you. If you need more fine control, you can disable AutoQuality mode and set the sample counts manually.
In addition to that, the performance cost scales very well with resolution scaling and the cost of using multiple outline styles at the same time stacks linearly.
Rendering Compatibility
While the effect was designed to work best with TAA, it does have automatic fallback solutions for FXAA, MSAA and no anti aliasing built in – look at the video/ screenshots to see what it looks like at different quality settings with different anti aliasing methods. The effect also automatically adjust to any screen resolution or resolution scaling.
Included Content
This product includes the Soft Outline master material and 20 material instances, each featuring a unique style.
You can contact us at any time and request that the asset you want be added to the site from the Request Asset section.