How can I create an outline highlight similar to the one used in the editor?

I’m trying to figure out how to generate an outline around a selected object. The effect I would like to create is pretty much just like the outline that appears around a selected object in the editor. How would I go about reproducing this effect?

Bumping this, I was looking for a similar solution and the closest I could find was post-processing edge detection materials, and they don’t work exactly the way I’d like them to.

I would also like to know. The editor highlight effect is very cool.

Hourences does go quite into depth about this in his new tutorial series, so check it out here :

://www.hourences/videos-index/

They aren`t free though, but well worth the money so far :slight_smile:

Probably this helps you: https://forums.epicgames/threads/865957-Object-Mesh-Outline-Effect-working

Bump, would be extremely useful. Also the tutorial @ linked to is from UE3, not UE4.

Yep, I know that it is from UDK, but it should work nearly the same in the UE4 ^^

Hi,

You can use custom depth rendering to create outline effect as a post process.

First you need to create a post process material that will compare backbuffer depth and custom depth. If difference is greater than a given threshold, then you should draw outline.

A sample material can be found here: https://dl.dropboxusercontent/u/896861/dev/PP_Outliner_M.rar
Just add it to blendables list in postprocess volume in your level.

Now you can toggle outline in editor by checking “Render Custom Depth” option in actor properties.

Unfortunately toggling outline in-game, requires a bit of coding in c++.
Basically you need to use this for each primitive component in actor:

comp->bRenderCustomDepth = true;
comp->MarkRenderStateDirty();

Cheers!

ps. The material is just for test and doesn’t always work as good as the one available in Editor.

You might also try creating a fresnel effect in the material.

Fresnel Effect

This works perfectly, thank you!

That’s very cool! But it doesn’t work on translucent object it seems :frowning:

This tutorial can help you create a highlight material updated to Unreal Engine Version 4.17.0

This tutorial shows you how to have multiple highlight colors in your project with a single material:

Enjoy!