# UE4 unaware of change in bRenderCustomDepth

**URL:** <https://forums.unrealengine.com/t/ue4-unaware-of-change-in-brendercustomdepth/310935>\
**Category:** Rendering\
**Tags:** Post-Processing, unreal-engine, CPP, question\
**Created:** [March 14, 2015, 12:45pm UTC](https://forums.unrealengine.com/t/ue4-unaware-of-change-in-brendercustomdepth/310935 "2015-03-14T12:45:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![SyMutex](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SyMutex](https://forums.unrealengine.com/u/SyMutex)\
**Post date:** [March 14, 2015, 12:45pm UTC](https://forums.unrealengine.com/t/ue4-unaware-of-change-in-brendercustomdepth/310935/1 "2015-03-14T12:45:42Z")

</div>

When I set **bRenderCustomDepth** to **true** on the mesh of my **ACharacter** actor, the desired highlight effect on the mesh doesn’t work until I change the **Cloth Blend Weight** value on the mesh to any value in the details section. It seems as if UE4 is unaware of the change made to bRenderCustomDepth during gameplay and only becomes aware of it the moment **Cloth Blend Weight** is changed manually in the details section.

---

<div class="post-metadata">

**Author:** ![SyMutex](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SyMutex](https://forums.unrealengine.com/u/SyMutex)\
**Post date:** [March 14, 2015, 1:10pm UTC](https://forums.unrealengine.com/t/ue4-unaware-of-change-in-brendercustomdepth/310935/2 "2015-03-14T13:10:53Z")

</div>

Solved it using **SetRenderCustomDepth()** instead of setting **bRenderCustomDepth** directly.

---

<div class="post-metadata">

**Author:** ![VSZ](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@VSZ](https://forums.unrealengine.com/u/VSZ)\
**Post date:** [June 6, 2015, 9:13pm UTC](https://forums.unrealengine.com/t/ue4-unaware-of-change-in-brendercustomdepth/310935/3 "2015-06-06T21:13:42Z")

</div>

Thank you for posting the solution, this one had me!

---

<div class="post-metadata">

**Author:** ![lukedan](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@lukedan](https://forums.unrealengine.com/u/lukedan)\
**Post date:** [August 6, 2018, 7:49am UTC](https://forums.unrealengine.com/t/ue4-unaware-of-change-in-brendercustomdepth/310935/4 "2018-08-06T07:49:15Z")

</div>

Well this is just bad design right here.

---

<div class="post-metadata">

**Author:** ![DrHobo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DrHobo](https://forums.unrealengine.com/u/DrHobo)\
**Post date:** [February 26, 2019, 11:41pm UTC](https://forums.unrealengine.com/t/ue4-unaware-of-change-in-brendercustomdepth/310935/5 "2019-02-26T23:41:20Z")

</div>

Bad design? Not really. Like many graphic functions in UE4 **SetRenderCustomDepth()** does not execute something immediately but rather sets the stage for a complex rendering pipeline by either telling the scene that this will have a given effect (true) or making the scene dirty so it can plan its removal (false). Therefore, you don’t want to waste time checking if a value has changed for a single effect change (as there are many values to check along the way). And yes, it will set **bRenderCustomDepth** but its effect will happen later on. The reason **bRenderCustomDepth** is public is only to be used in the constructor (or a Blueprint check mark on the properties sheet) by which the complex rendering pipeline will kick in eventually for the first time and take that flag into account.

So it’s always confusing as we (myself included) take for granted that the first match Intellisence will give us is the good one and assume that this should “just work”.

There are many bXXX values that have a SetXXX() equivalent in UE4. Just keep a sharp eye as to when to use them. 🙂
