# Casting Shadows for Virtual Objects using Occlusion Material

**URL:** <https://forum.magicleap.cloud/t/casting-shadows-for-virtual-objects-using-occlusion-material/3634>\
**Category:** Unity Development\
**Tags:** shaders\
**Created:** [June 12, 2024, 2:42pm UTC](https://forum.magicleap.cloud/t/casting-shadows-for-virtual-objects-using-occlusion-material/3634 "2024-06-12T14:42:22Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Zul01](https://avatars.discourse-cdn.com/v4/letter/z/4da419/32.png) [@Zul01](https://forum.magicleap.cloud/u/Zul01)\
**Post date:** [June 13, 2024, 5:48am UTC](https://forum.magicleap.cloud/t/casting-shadows-for-virtual-objects-using-occlusion-material/3634/5 "2024-06-13T05:48:50Z")

</div>

I am using the Occlusion material provided in the magic leap examples which uses the following shader :

![image](https://us1.discourse-cdn.com/flex019/uploads/magicleap1/original/2X/4/43e24d468fc9ae7d601ce725602c563fb2da0735.png)

Also, the occlusion material appears black in video recordings. I came across a similar post that suggested to enable segmented dimming as a solution: [Occlusion shader video recording issues - #10 by petrebasura](https://forum.magicleap.cloud/t/occlusion-shader-video-recording-issues/2575/10)

I did not face this issue when I used the Magic Leap Example project - I didn't have the dimmer enabled and the recording seemed to render the occlusion fine.

However, for my own project which is configured with MagicLeap-MRTK, I find issues regarding the black rendering in the recordings. I tried enabling basic segmented dimming and still faced this issue. Can you please advise on how can this be fixed as I need occlusion in my project. Thanks.

---

_[View the full topic](https://forum.magicleap.cloud/t/casting-shadows-for-virtual-objects-using-occlusion-material/3634)._
