# Unable to render Custom Depth with translucent material applied

**URL:** <https://forums.unrealengine.com/t/unable-to-render-custom-depth-with-translucent-material-applied/285452>\
**Category:** Asset Creation\
**Tags:** depth, unreal-engine, question\
**Created:** [June 9, 2014, 7:21pm UTC](https://forums.unrealengine.com/t/unable-to-render-custom-depth-with-translucent-material-applied/285452 "2014-06-09T19:21:32Z")\
**Posts on this page:** 12\
**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:** [June 9, 2014, 7:21pm UTC](https://forums.unrealengine.com/t/unable-to-render-custom-depth-with-translucent-material-applied/285452/1 "2014-06-09T19:21:32Z")

</div>

I’m unable to see the mesh rendered into Custom Depth while I have a translucent material applied. This does work with any opaque material.

Nasty workaround is to create a blueprint with second copy of mesh (gets works when animation gets involved) that is only drawn into custom depth and not main pass and has a simple opaque material applied.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_2db7ca80](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_2db7ca80](https://forums.unrealengine.com/u/anonymous_user_2db7ca80)\
**Post date:** [June 23, 2015, 12:46pm UTC](https://forums.unrealengine.com/t/unable-to-render-custom-depth-with-translucent-material-applied/285452/2 "2015-06-23T12:46:41Z")

</div>

Is this intended behaviour? It also stops the object showing up the scene depth texture, it would be nice if it could be toggled on a per object basis. [This comment seems to suggest is intended behaviour but sadly doesn’t elaborate on how to change it.](https://answers.unrealengine.com/questions/98542/issues-with-rendering-custom-depth.html#comment-99446)

---

<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/unable-to-render-custom-depth-with-translucent-material-applied/285452/3 "2016-03-03T22:39:40Z")

</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:** ![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/unable-to-render-custom-depth-with-translucent-material-applied/285452/4 "2016-03-03T22:39:46Z")

</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:** ![Bionic\_Ape](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/bionic_ape/32/1090124_2.png) [@Bionic\_Ape](https://forums.unrealengine.com/u/Bionic_Ape)\
**Post date:** [November 21, 2016, 11:16am UTC](https://forums.unrealengine.com/t/unable-to-render-custom-depth-with-translucent-material-applied/285452/5 "2016-11-21T11:16:00Z")

</div>

There is a property called “Allow Custom Depth Writes” within “Translucency”. Set it to true and it will compile additional shaders to enable custom depth.

I hope this helps.

---

<div class="post-metadata">

**Author:** ![uNfree](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@uNfree](https://forums.unrealengine.com/u/uNfree)\
**Post date:** [October 27, 2017, 9:21am UTC](https://forums.unrealengine.com/t/unable-to-render-custom-depth-with-translucent-material-applied/285452/6 "2017-10-27T09:21:49Z")

</div>

Thanks, that works for me.

---

<div class="post-metadata">

**Author:** ![Adder1812](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Adder1812](https://forums.unrealengine.com/u/Adder1812)\
**Post date:** [October 2, 2018, 9:43am UTC](https://forums.unrealengine.com/t/unable-to-render-custom-depth-with-translucent-material-applied/285452/7 "2018-10-02T09:43:42Z")

</div>

Perfect!! Thanks!!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_886519d51](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_886519d51](https://forums.unrealengine.com/u/anonymous_user_886519d51)\
**Post date:** [January 31, 2019, 11:32pm UTC](https://forums.unrealengine.com/t/unable-to-render-custom-depth-with-translucent-material-applied/285452/8 "2019-01-31T23:32:32Z")

</div>

It has not been mentioned before, but I want to point out that you need to set the “Opacity Mask Clip Value” of the Material properties to something you can work with. For example. Currently in UE4 4.20, this value is set to 0.33. If you use the technique above with a translucent material set to 0.32 in opacity, the post processing material will not show.

In my case, i need to show only the outline of a completely transparent material, so I had to set this value to 0.0.

---

<div class="post-metadata">

**Author:** ![Rilke](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rilke/32/726197_2.png) [@Rilke](https://forums.unrealengine.com/u/Rilke)\
**Post date:** [July 30, 2019, 5:49am UTC](https://forums.unrealengine.com/t/unable-to-render-custom-depth-with-translucent-material-applied/285452/9 "2019-07-30T05:49:19Z")

</div>

Yes, especially at 4.22.3

---

<div class="post-metadata">

**Author:** ![SVR33](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/svr33/32/906589_2.png) [@SVR33](https://forums.unrealengine.com/u/SVR33)\
**Post date:** [September 28, 2021, 9:46pm UTC](https://forums.unrealengine.com/t/unable-to-render-custom-depth-with-translucent-material-applied/285452/10 "2021-09-28T21:46:08Z")

</div>

you’re my hero!

---

<div class="post-metadata">

**Author:** ![Shmoopy1701](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/shmoopy1701/32/1194536_2.png) [@Shmoopy1701](https://forums.unrealengine.com/u/Shmoopy1701)\
**Post date:** [April 27, 2023, 5:56pm UTC](https://forums.unrealengine.com/t/unable-to-render-custom-depth-with-translucent-material-applied/285452/11 "2023-04-27T17:56:26Z")

</div>

Since this thread coming up in Google… As of engine version 5.03 looks like messing with the “Opacity Clip Mask Value” is no longer needed. The field is read-only unless using a Masked material.

If you: (1) have “Translucency \>\> Enable Custom Depth Writes == true” and (2) a value greater than .333 going into your Opacity, then the object will work with depth buffer highlighting. 🕶

---

<div class="post-metadata">

**Author:** ![flankechen](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@flankechen](https://forums.unrealengine.com/u/flankechen)\
**Post date:** [August 11, 2023, 5:01pm UTC](https://forums.unrealengine.com/t/unable-to-render-custom-depth-with-translucent-material-applied/285452/12 "2023-08-11T17:01:23Z")

</div>

something close to this topic is when translucent mat is shown, scene depth is wrong from the texture sampler. “Allow Custom Depth Writes” dosent help this.  
Any idea about how to get the right scene depth while tranparent object is on?
