# How to hide outline post process effect behind objects

**URL:** <https://forums.unrealengine.com/t/how-to-hide-outline-post-process-effect-behind-objects/335022>\
**Category:** Asset Creation\
**Tags:** custom-depth, unreal-engine, question\
**Created:** [October 12, 2015, 7:46am UTC](https://forums.unrealengine.com/t/how-to-hide-outline-post-process-effect-behind-objects/335022 "2015-10-12T07:46:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_4162f6d5](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_4162f6d5](https://forums.unrealengine.com/u/anonymous_user_4162f6d5)\
**Post date:** [October 12, 2015, 7:46am UTC](https://forums.unrealengine.com/t/how-to-hide-outline-post-process-effect-behind-objects/335022/1 "2015-10-12T07:46:51Z")

</div>

I created an outline effect following the instructions in this tutorial:

[outline tutorial][1]

I had to create the M\_highlight material because I couldn’t find it in the content examples. I think it is no longer available there.  
Maybe I messed that up. But I can’t find any problem with it.

Anyway, most of the material works fine, I am perfectly happy with the outline. Only thing is, that it is drawn on top of the whole scene. So if I place an object in front of the object with the outline and do not activate its “custom depth pass” the outline of the other object is rendered on top of this. Like in this screenshot:

 ![62311-outline_issue.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/4/c/84c9f450414d5571997bee24b4d4630d7963f393.jpeg)

Here is the material I recreated from the video:

 ![highlightMat.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/3X/1/a/1a2687f030a07606c460f0c2cf09fec327ffcb16.jpeg)

Any idea what i did wrong???  
Every help would be much appreciated.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_4162f6d5](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_4162f6d5](https://forums.unrealengine.com/u/anonymous_user_4162f6d5)\
**Post date:** [October 13, 2015, 11:23am UTC](https://forums.unrealengine.com/t/how-to-hide-outline-post-process-effect-behind-objects/335022/2 "2015-10-13T11:23:09Z")

</div>

Is there another way to do this, if it is not possible to achieve the desired result using the M\_highlight material and post-processing?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_c447bec0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_c447bec0](https://forums.unrealengine.com/u/anonymous_user_c447bec0)\
**Post date:** [November 3, 2015, 4:30pm UTC](https://forums.unrealengine.com/t/how-to-hide-outline-post-process-effect-behind-objects/335022/3 "2015-11-03T16:30:46Z")

</div>

I think you will find an answer there : [Disabling Custom Depth Rendering on certain objects - Rendering - Epic Developer Community Forums](https://answers.unrealengine.com/questions/137441/disabling-custom-depth-rendering-on-certain-object.html)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_8b31b095](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_8b31b095](https://forums.unrealengine.com/u/anonymous_user_8b31b095)\
**Post date:** [April 30, 2016, 11:42am UTC](https://forums.unrealengine.com/t/how-to-hide-outline-post-process-effect-behind-objects/335022/4 "2016-04-30T11:42:06Z")

</div>

Hi, you need to subtract ocluded parts from your Stencil / Custmom Depth:

 ![89015-occlusion.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/5/8/7580625d02074184ed2dbfb0fcfa40ba8162aaa1.png)

---

<div class="post-metadata">

**Author:** ![42Kam1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@42Kam1](https://forums.unrealengine.com/u/42Kam1)\
**Post date:** [July 26, 2023, 1:00pm UTC](https://forums.unrealengine.com/t/how-to-hide-outline-post-process-effect-behind-objects/335022/5 "2023-07-26T13:00:28Z")

</div>

it works, you’ve saved my day )
