Unreal Engine Soft Outlines UE8256

Soft Outlines

See demo of the 20 outline styles includedAll styles support occlusion with the options of only showing occluded areas, only showing non-occluded areas or always showing everything.

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

  1. Add a post process volume to your level and check the “Infinite Extent” tick box in the details panel
  2. Find the Post Process Materials section and add a new asset reference to the “Post Process Materials”
  3. Assign a material instance (Style) of the SoftOutline material to the asset reference
  4. Select meshes you wish to receive the outline and enable the “Render CustomDepth Pass” tick box
  5. 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):

  1. In the project settings set “Custom Depth-Stencil Pass” to “Enabled with Stencil”
  2. 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)
  3. 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.

Feedback

Feel free to contact me at decal_portal459@simplelogin.com if you run into any issues or have any feature requests.