Material for Orange Outlines on Selected Actor

Hi there,

when you select actors in Unreal Engine editor, they get an orange outline around them. I want same behavior ingame (for character selection screens and stuff like that), but I looked all thorugh the engine content and couldn’t find the material that is responsible for effect. Can anyone help out? Or alternatively help me recreate effect with an own material?

Thanks in advance

You could make the material of the selected object output to CustomDepth when it gets picked, and then in a fullscreen post process pass you can do your outline math using the custom depth as your source for computing outlines.

The wiki has a great example of how to do ; .unrealengine/latest/INT/Engine/Rendering/PostProcessEffects/PostProcessMaterials/index.html

Thanks for the reply.
I think isn’t exactly what I need, though. Since that material adss outlines based on the depth buffer, a selected object might have multiple outlines depending on its geometry (see the second mesh in that example). What I rather want is just a single outline around the whole object, just like UE editor is doing it. I don’t think can be done with just the depth buffer alone. I guess it needs a rendertarget or something to work.

Take a look at thread: https://forums.epicgames/threads/865957-Object-Mesh-Outline-Effect-working Probably UDK tutorial is still working in the UE4 :slight_smile:

Thanks, that’s getting closer already. But judging by the screenshots that method still seems to have some issues. Like: The character (in the second screenshot) has an outline around his whole left hand, he has random red dots on his knee and he barely has any outlines around his feet. UE4 editor’s approach is still somewhat better. Something like is what I want:

For example: geometry, that is close to each other in screen space (like the characters on the right) should share a single outline instead of each having an outline of their own.

Not sure if it helps but here’s one way of doing it:

https://answers.unrealengine/questions/53155/material-with-border.html

No, the presented solution only applies to spheres as he uses the PixelNormals to generate the outline and looks ugly on other objects:



I was just reading through some articles posted on a blog, and happened to come across , so I thought I would give you the link.

is a tutorial that goes over exactly what you are looking for, breaks it down step by step, and even has a sample project you can download (including a sample material). His material is blue, but that is not hard to change:

Hope that helps! :slight_smile:

That’s a nice blog post but you really don’t need to use the sobel operator for some plain edge detection.

Here’s a simple material which should do the job:

The threshold parameter defines the distance in world space up to which geometry shares the same outline. Note how in example both spheres have a single outline whilst the bush in the background gets separated due to the distance exceeding the threshold:

Thanks, and ! I think that is actually what I need. That should solve my problem. :wink:

I have another question now. I want to use same effect (I used the one from the tutorial) on a scene capture, but it won’t work. I added PP_Outliner_Inst to the SceneCapture’s Blendables List, set Blend Weight to 1.0 and set Render Custom Depth on some meshes to true. The outlines are visible on all regular cameras, but not on rendertargets that I write to with Scene Capture. Apparently there was a bug on UE 4.0.2 where the engine ignored Blendables on Scene Captures. I’m on UE 4.1.1, though. Wasn’t the bug fixed by then? The thread where I read about the bug also has a link to a proposed fix of the bug, but since I don’t currently have a UE subscription (and am completely broke) I can’t open that link (it’s on Epic’s github page), so I’m unable to find out if it’s the same bug and if I can fix it.

is the thread I’m referring to:

https://answers.unrealengine/questions/26689/bug-blendable-postprocess-materials-dont-work-with.html

And is where the proposed fix can be found:

https://github/EpicGames/UnrealEngine/pull/55

Is someone here able to see that page? If so, can you quote how to fix the bug for me? Thanks in advance!

Hi there,

I would love to use that material in 4.9+. I had to make some small modifications to compile it:

://i.imgur/l8fbzXR.png

(Here’s the code for copy&pasting: ://pastebin/EqN3j3zb)

(SceneTexture:SceneColor now has to be SceneTexture:PostProcessInput0 and I had to mask out alpha before the lerp-node at the end).

Unfortunately it just renders the whole screen with the outline color now:

Did I make any mistake? I just added an unbounded post-processing volume, added material as a blendable and activated ‘render custom depth’ for a mesh in the scene…

Works perfectly. Kudos for posting . :slight_smile:

You are dividing by 0, fix that and it works…


7WPZZYu.png

Soooo, shader broke in 4.9+. Anyone have any ideas why?

EDIT: Fix found here. Basically just 1 node needs 1 setting changed. Easy to fix:

https://answers.unrealengine/questions/295984/49-post-processing-highlight-material.html

Does shader still work in 4.14? I tried to recreate it and it isn’t working for me, only rendering the shape as black with no outline.

https://i.gyazo/e6c3dd17575dd1cda92ad380490e9b24.png

is my setup, I also have a global post process volume in the level that has material in the blendables tab. What am I doing wrong?

It appears to still be working for me in 4.14, you can look in the SDK for the Content/Materials/PP_OutlineColored to get the following…

a265a904b1e043ec809a9888f30e3a51.png

://www.tomlooman/multi-color-outline-post-process-in-unreal-engine-4/

Using , great blueprint, allows you to have multiple colors on multiple objects in game.

-JB

Yep, I started here and then eventually looked at what Tom provided, which is a great blog / resource and everyone should subscribe. I forget how much of what came from what but I think ours mostly came from Tom’s work.

You didn’t give the Outline Size a value. It needs to be 1 or more not 0. Also Your threshold number is really low. That needs to be increased as it’s the world space distance that the effect works at. Try a value of 20480 or higher. thread is like a game of telephone, everyone changed the values just a bit and now it’s all muddled.