# Issues with rendering Custom Depth

**URL:** <https://forums.unrealengine.com/t/issues-with-rendering-custom-depth/293679>\
**Category:** Rendering\
**Tags:** occlusion, custom-depth, unreal-engine, Rendering, question\
**Created:** [September 14, 2014, 1:52pm UTC](https://forums.unrealengine.com/t/issues-with-rendering-custom-depth/293679 "2014-09-14T13:52:10Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tom\_Looman](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/tom_looman/32/1215549_2.png) [@Tom\_Looman](https://forums.unrealengine.com/u/Tom_Looman)\
**Post date:** [September 14, 2014, 1:52pm UTC](https://forums.unrealengine.com/t/issues-with-rendering-custom-depth/293679/1 "2014-09-14T13:52:10Z")

</div>

I wrote post about using Custom Depth in Unreal 4 and hit a few bumps that I hope you guys could look into.

> **[Custom Depth in Unreal Engine 4](https://www.tomlooman.com/the-many-uses-of-custom-depth-in-unreal-4/)**
>
> Unreal Engine 4 introduced a new depth buffer along with their PBR rendering system. It’s called “Custom Depth” and can be used for effects like the selection outline that is built-in the Editor, rendering of...

**Issues**

- The built-in occlusion culling does currently not play nice with Custom Depth – this means that a mesh you wish to highlight behind other geometry will get occludedregardless. A workaround is to increase the Bounds Scale under Rendering properties for a given mesh, this is very undesirable.
- Objects that use transparent meshes are not rendered into custom depth. While I know why this happens - I find it highly undesirable and would like to just render a solid color opaque material when drawing into custom depth. This adds a huge burden when using this on skeletal meshes (having to keep a 2nd mesh in a blueprint and syncing all animations is not something you wish to do)

I reported the occlusion issue earlier and it was said it was fixed - using 4.4 it’s still occurring for me.

---

<div class="post-metadata">

**Author:** ![Ehamloptiran\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ehamloptiran\_1](https://forums.unrealengine.com/u/Ehamloptiran_1)\
**Post date:** [September 16, 2014, 5:30am UTC](https://forums.unrealengine.com/t/issues-with-rendering-custom-depth/293679/2 "2014-09-16T05:30:10Z")

</div>

> I find it highly undesirable and would like to just render a solid color opaque material when drawing into custom depth

This is how I handled Translucent objects in Custom Depth, I added some code to allow me to check from the Scene Proxy if its currently rendering Custom Depth, and if my object is translucent I swap out the material for a basic opaque material.

 ![15530-translucentcustomdepth.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/8/4/f84a548f3b0228c6cf4330f56ad2cdbc524c5118.jpeg)

---

<div class="post-metadata">

**Author:** ![KillerPenguin](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/killerpenguin/32/1005607_2.png) [@KillerPenguin](https://forums.unrealengine.com/u/KillerPenguin)\
**Post date:** [April 24, 2015, 6:20am UTC](https://forums.unrealengine.com/t/issues-with-rendering-custom-depth/293679/3 "2015-04-24T06:20:18Z")

</div>

Yeah, hit the same problem here mate.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_c0687f281](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_c0687f281](https://forums.unrealengine.com/u/anonymous_user_c0687f281)\
**Post date:** [December 14, 2015, 6:53pm UTC](https://forums.unrealengine.com/t/issues-with-rendering-custom-depth/293679/4 "2015-12-14T18:53:21Z")

</div>

Still same problem with UE 4.10

---

<div class="post-metadata">

**Author:** ![RyanB](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RyanB](https://forums.unrealengine.com/u/RyanB)\
**Post date:** [March 3, 2016, 10:39pm UTC](https://forums.unrealengine.com/t/issues-with-rendering-custom-depth/293679/5 "2016-03-03T22:39:54Z")

</div>

You will need a separate mesh with an opaque material currently. You can set that copy to not render in main pass and to render only in custom depth.

---

<div class="post-metadata">

**Author:** ![Tom\_Looman](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/tom_looman/32/1215549_2.png) [@Tom\_Looman](https://forums.unrealengine.com/u/Tom_Looman)\
**Post date:** [March 5, 2016, 7:19pm UTC](https://forums.unrealengine.com/t/issues-with-rendering-custom-depth/293679/6 "2016-03-05T19:19:49Z")

</div>

That’s what I’ve been using up to this point. Any chance the Custom Depth will be changed to use simple opaque material when the flag is set on a translucent object?

---

<div class="post-metadata">

**Author:** ![think01](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/think01/32/713467_2.png) [@think01](https://forums.unrealengine.com/u/think01)\
**Post date:** [August 16, 2019, 1:20pm UTC](https://forums.unrealengine.com/t/issues-with-rendering-custom-depth/293679/7 "2019-08-16T13:20:01Z")

</div>

To anyone interested: the transparent mesh not drawn in custom depth was solved with a flag in the material: “Allow Custom Depth Writes” within “Translucency”.

Original post reporting this: [Unable to render Custom Depth with translucent material applied - Asset Creation - Unreal Engine Forums](https://answers.unrealengine.com/questions/54366/unable-to-render-custom-depth-with-translucent-mat.html)
