# Custom depth outline draws over any object that doesn't have checked Render Custom Depth

**URL:** <https://forums.unrealengine.com/t/custom-depth-outline-draws-over-any-object-that-doesnt-have-checked-render-custom-depth/67455>\
**Category:** Rendering\
**Tags:** unreal-engine\
**Created:** [June 25, 2016, 7:16pm UTC](https://forums.unrealengine.com/t/custom-depth-outline-draws-over-any-object-that-doesnt-have-checked-render-custom-depth/67455 "2016-06-25T19:16:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ViaCognita](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/viacognita/32/906601_2.png) [@ViaCognita](https://forums.unrealengine.com/u/ViaCognita)\
**Post date:** [June 25, 2016, 7:16pm UTC](https://forums.unrealengine.com/t/custom-depth-outline-draws-over-any-object-that-doesnt-have-checked-render-custom-depth/67455/1 "2016-06-25T19:16:28Z")

</div>

I’m newbie in Unreal development and I want to draw an outline only around some actors on my level.

I have found a lot of tutorials about it, and all of them draw the outline using Custom Depth buffer. Here are some of the tutorials that I have found:

[http://www.tomlooman.com/the-many-uses-of-custom-depth-in-unreal-4/](http://www.tomlooman.com/the-many-uses-of-custom-depth-in-unreal-4/)  
[http://www.michalorzelek.com/blog/tutorial-creating-outline-effect-around-objects/](http://www.michalorzelek.com/blog/tutorial-creating-outline-effect-around-objects/)  
[https://www.youtube.com/watch?v=IEHxjw6VEMQ](https://www.youtube.com/watch?v=IEHxjw6VEMQ)

Now I’m working on the last one (youtube), and as you can see on second 0:43, the steps’ is hidden by the player:

![CustomDepth03.png](https://d3kjluh73b9h9o.cloudfront.net/original/3X/2/c/2cb16374f7f949fe618913ce9d3fe762534ebdf3.png)

This is because both, the player and the steps, have _Render Custom depth_ checked.

This doesn’t happen on my level, because my player’s gun doesn’t have checked _Render Custom Depth_. Look:

![CustomDepth01.png](https://d3kjluh73b9h9o.cloudfront.net/original/3X/f/d/fdbff9afe336d7bf6bd4f2e12996e08cfba0f364.png)

But here, I have checked it on two squares:

![CustomDepth02.png](https://d3kjluh73b9h9o.cloudfront.net/original/3X/8/8/885f71237666d87f7ef83a505aa73d6f73990b81.png)

The furthest square doesn’t draw its outline in front of the nearest square.

My problem here if I check Render Custom Depth in all of my actor, even in the ones that I don’t need it, I will have all of the outlined.

I need to normalize SceneDepth to only outline NOT hidden geometry. Any idea about how to do it?
