# Render occluded actors

**URL:** <https://forums.unrealengine.com/t/render-occluded-actors/316561>\
**Category:** C++\
**Tags:** Renderer, unreal-engine, question, CPP\
**Created:** [April 27, 2015, 11:02am UTC](https://forums.unrealengine.com/t/render-occluded-actors/316561 "2015-04-27T11:02:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![csharp1024](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@csharp1024](https://forums.unrealengine.com/u/csharp1024)\
**Post date:** [April 27, 2015, 11:02am UTC](https://forums.unrealengine.com/t/render-occluded-actors/316561/1 "2015-04-27T11:02:49Z")

</div>

Similar to [https://answers.unrealengine.com/questions/54283/render-occluded-actor-in-custom-depth.html](https://answers.unrealengine.com/questions/54283/render-occluded-actor-in-custom-depth.html)

I wanted to render actors with an outline through walls, but extending the bounds scale seems like to much of a hack and reduces performance. If there isn’t another supported way to do this, can anyone lead me in a direction where I can modify the engine to always render to the custom depth?

---

<div class="post-metadata">

**Author:** ![Pierdek](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Pierdek](https://forums.unrealengine.com/u/Pierdek)\
**Post date:** [April 27, 2015, 11:23am UTC](https://forums.unrealengine.com/t/render-occluded-actors/316561/2 "2015-04-27T11:23:20Z")

</div>

I think you are looking for this change:

[https://github.com/EpicGames/UnrealEngine/commit/4cfa4288d42a0d08aff12832a8a28bc3e07a2ffb](https://github.com/EpicGames/UnrealEngine/commit/4cfa4288d42a0d08aff12832a8a28bc3e07a2ffb)

```
bool FSkeletalMeshSceneProxy::CanBeOccluded() const
 {
-	return !MaterialRelevance.bDisableDepthTest;
+	return !MaterialRelevance.bDisableDepthTest && !ShouldRenderCustomDepth();
 }

```

It is not in the official builds neither in the promoted branch.

---

<div class="post-metadata">

**Author:** ![csharp1024](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@csharp1024](https://forums.unrealengine.com/u/csharp1024)\
**Post date:** [April 27, 2015, 11:36am UTC](https://forums.unrealengine.com/t/render-occluded-actors/316561/3 "2015-04-27T11:36:37Z")

</div>

Neat. I’ll look into this later, but I think it does what I want. Thanks.

---

<div class="post-metadata">

**Author:** ![csharp1024](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@csharp1024](https://forums.unrealengine.com/u/csharp1024)\
**Post date:** [April 27, 2015, 9:17pm UTC](https://forums.unrealengine.com/t/render-occluded-actors/316561/4 "2015-04-27T21:17:12Z")

</div>

Yeah, that totally works. Now I have sweet character outlines through walls 😃

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b2a191a4](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b2a191a4](https://forums.unrealengine.com/u/anonymous_user_b2a191a4)\
**Post date:** [August 26, 2015, 11:30am UTC](https://forums.unrealengine.com/t/render-occluded-actors/316561/5 "2015-08-26T11:30:55Z")

</div>

Hi, I’m on 4.8.2 now and can’t get bRenderCustomDepth to work with neither StaticMesh nor Skeletal. It should be just the setting of the property on the actor, right?

Debugging the code showed that it should be working, it goes through the code path to render the specific meshes I have marked for custom depth pass. But I still cannot see them behind walls. And I was wondering if you could help?

Thanks!  
Wessam
