# Rendering overlapping custom depth pass objects

**URL:** <https://forums.unrealengine.com/t/rendering-overlapping-custom-depth-pass-objects/444971>\
**Category:** Blueprint\
**Tags:** custom-depth, unreal-engine, UE4, question, Blueprint\
**Created:** [March 9, 2019, 11:01pm UTC](https://forums.unrealengine.com/t/rendering-overlapping-custom-depth-pass-objects/444971 "2019-03-09T23:01:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrew\_Beaubien](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Andrew\_Beaubien](https://forums.unrealengine.com/u/Andrew_Beaubien)\
**Post date:** [March 9, 2019, 11:01pm UTC](https://forums.unrealengine.com/t/rendering-overlapping-custom-depth-pass-objects/444971/1 "2019-03-09T23:01:41Z")

</div>

I’m new to using Custom Depth Pass as a tool, and have only been using it for outlines thus far. The one problem that I’ve yet to solve is that when two objects drawn in the custom depth pass overlap, only their joint outline is drawn, while I’d like their individual outlines to be superimposed.  
So, what I have right now is this:

![270835-current.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/4/2/3428160dfbd208770ac484bcd097feea120538d7.png)

And what I’d like to have is this, with the occluded portion of the sphere’s outline in orange, not red (No orange brush in Snip):

![270837-desired.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/b/0/0b04b73db8e50e99bda7c779259c44a72a18eb63.png)

Is this possible using the custom depth pass? Is there an another way to get this effect?

---

<div class="post-metadata">

**Author:** ![II\_ADN\_II](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ii_adn_ii/32/1194656_2.png) [@II\_ADN\_II](https://forums.unrealengine.com/u/II_ADN_II)\
**Post date:** [March 11, 2019, 6:44pm UTC](https://forums.unrealengine.com/t/rendering-overlapping-custom-depth-pass-objects/444971/2 "2019-03-11T18:44:06Z")

</div>

I dont think its possible to get that effect without using transparency.

With a depth buffer you only have whats in the front, not the back. This will work only for one object using the buffer, and sampling the other in the standar depth, wich is odd and problematic in many cases. But nontheless it will work if you only want the sphere to be visible behind objects.

---

<div class="post-metadata">

**Author:** ![juanpyguzman](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@juanpyguzman](https://forums.unrealengine.com/u/juanpyguzman)\
**Post date:** [November 3, 2023, 8:12am UTC](https://forums.unrealengine.com/t/rendering-overlapping-custom-depth-pass-objects/444971/3 "2023-11-03T08:12:17Z")

</div>

Hello Andrew,  
how can I get what it’s seen in first image?  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/2/b/d2b53826aaf7c2711e380bd7814652be4ddba2cb.jpeg)

Thank you!
