# Make ZED occlusion affect the alpha channel in Unreal’s render output

**URL:** <https://community.stereolabs.com/t/make-zed-occlusion-affect-the-alpha-channel-in-unreal-s-render-output/10129>\
**Category:** Unreal Engine\
**Tags:** depth\
**Created:** [October 9, 2025, 1:34pm UTC](https://community.stereolabs.com/t/make-zed-occlusion-affect-the-alpha-channel-in-unreal-s-render-output/10129 "2025-10-09T13:34:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![emile](https://community.stereolabs.com/letter_avatar_proxy/v4/letter/e/58956e/32.png) [@emile](https://community.stereolabs.com/u/emile)\
**Post date:** [October 9, 2025, 1:34pm UTC](https://community.stereolabs.com/t/make-zed-occlusion-affect-the-alpha-channel-in-unreal-s-render-output/10129/1 "2025-10-09T13:34:35Z")

</div>

Hey everyone!

I’m using the **ZED plugin** in Unreal Engine to composite virtual objects into a live camera scene. I’d like to generate an image where the **virtual objects are properly masked based on their occlusion** (I’ve included images showing my current result and the desired outcome).

Right now, if I deselect **“Show ZED Image”** on the BP\_ZED\_Initializer—so the camera feed isn’t visible—I lose all occlusion effects.

Has anyone run into this before or know how I can achieve the proper occlusion masking? 😄

Thanks in advance for any help!  
/Emile

 ![BallBehindPlant](https://community.stereolabs.com/uploads/default/original/2X/d/df05a81792cb56a27c6e2f47a76aaa5fb45f1d64.png)

 ![BallMask](https://community.stereolabs.com/uploads/default/original/2X/9/944c19ccc2c513b4cd5aa37ba1f3d0ff1d9e8954.png)

---

<div class="post-metadata">

**Author:** ![BenjaminV](https://community.stereolabs.com/user_avatar/community.stereolabs.com/benjaminv/32/3863_2.png) [@BenjaminV](https://community.stereolabs.com/u/BenjaminV)\
**Post date:** [October 10, 2025, 10:04am UTC](https://community.stereolabs.com/t/make-zed-occlusion-affect-the-alpha-channel-in-unreal-s-render-output/10129/2 "2025-10-10T10:04:54Z")

</div>

I don’t know if that’s the easiest solution but you can create a custom material to compute this mask.  
You can take our material as ref (you can find it in Plugins/[Stereolabs](https://www.stereolabs.com/)/Content/ZED/Materials/Mono/M\_ZED\_Mono.uasset

---

<div class="post-metadata">

**Author:** ![emile](https://community.stereolabs.com/letter_avatar_proxy/v4/letter/e/58956e/32.png) [@emile](https://community.stereolabs.com/u/emile)\
**Post date:** [October 10, 2025, 11:14am UTC](https://community.stereolabs.com/t/make-zed-occlusion-affect-the-alpha-channel-in-unreal-s-render-output/10129/3 "2025-10-10T11:14:40Z")

</div>

Thanks! I’ll take a look at that one. I ended up getting it working using custom depth layers but your way seems more efficient 😄
