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?
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.
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.
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:
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:
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.
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…
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.