# Help with Outline material.

**URL:** <https://forums.unrealengine.com/t/help-with-outline-material/2024157>\
**Category:** Rendering\
**Tags:** Post-Processing, outline, unreal-engine, question\
**Created:** [September 17, 2024, 8:37am UTC](https://forums.unrealengine.com/t/help-with-outline-material/2024157 "2024-09-17T08:37:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![T0rgue](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@T0rgue](https://forums.unrealengine.com/u/T0rgue)\
**Post date:** [September 17, 2024, 8:37am UTC](https://forums.unrealengine.com/t/help-with-outline-material/2024157/1 "2024-09-17T08:37:08Z")

</div>

I am making a generic outline material, so it works on any mesh. Essentially I am trying to make a Sobel-esque outline, but I need help with what to do when the outlined object is behind another object.

Currently it does outline the mesh correctly, as it is using the CustomStencil buffer to allow for multiple colored outlines.  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/7/a/87ad5e80a5e9744c89eb6d7d5b4f775f88802556.jpeg)

But I want it to outline where it intersects the floor, something like this.  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/6/4/764dab5300f55c2b4bd5134bc11f07345d375e35.jpeg)

Imagine that, but the same color all around, is what I am after.

Any guidance or links to tutorials with outlines like this would be greatly appreciated. Thanks.

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [September 17, 2024, 9:34am UTC](https://forums.unrealengine.com/t/help-with-outline-material/2024157/2 "2024-09-17T09:34:37Z")

</div>

You might try combining what you have with either a depth fade node, or mesh distance fields.

I also saw

> [@Outline effect on mesh intersection. Is it possible?](https://forums.unrealengine.com/t/outline-effect-on-mesh-intersection-is-it-possible/88505/6):
>
> Updating this after long time, after trying a lot of things including different stencils, I found this post (in japanese which I don’t speak): [http://ogimafu.blogspot.com.br/2015/04/ue4.html](http://ogimafu.blogspot.com.br/2015/04/ue4.html) It combines Custom Depth with Normals to give more details to the edges and it works but there are still a few tweaks I would like to make. Here you can see the boxes intersecting each other. I’m still having 2 problems: The first is that in some cases this just doesn’t work. It seems to …
