# Why is my Masked Material Not Casting Shadows?

**URL:** <https://forums.unrealengine.com/t/why-is-my-masked-material-not-casting-shadows/285028>\
**Category:** Rendering\
**Tags:** tutorial, Shadows, opacity, unreal-engine, masked, question\
**Created:** [June 5, 2014, 1:17am UTC](https://forums.unrealengine.com/t/why-is-my-masked-material-not-casting-shadows/285028 "2014-06-05T01:17:49Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Knobbynobbes](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Knobbynobbes](https://forums.unrealengine.com/u/Knobbynobbes)\
**Post date:** [June 5, 2014, 1:17am UTC](https://forums.unrealengine.com/t/why-is-my-masked-material-not-casting-shadows/285028/1 "2014-06-05T01:17:49Z")

</div>

So, I just followed the tutorial on how to do location based opacity in UE4 and I noticed that none of the objects that are masked are creating shadows. The sides of brushes that do not have the material on them cast shadows, and brushes that don’t have the material on them cast shadows, but anything that I put that material on doesn’t cast a shadow, even static meshes (I used the material test objects as you can see in the upper left). Whats wrong?

 ![7771-maskedmaterialnoshadows.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/e/a/bea0c3ae875517758ee7cccc9120a73ef5200599.jpeg)

---

<div class="post-metadata">

**Author:** ![Lovecraft\_K](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Lovecraft\_K](https://forums.unrealengine.com/u/Lovecraft_K)\
**Post date:** [June 5, 2014, 5:47pm UTC](https://forums.unrealengine.com/t/why-is-my-masked-material-not-casting-shadows/285028/2 "2014-06-05T17:47:35Z")

</div>

Hi Knobbynobbes -

Have you double checked to make sure that the Material’s Attributes are set to Masked and not Translucent?

Thank You

Eric Ketchum

---

<div class="post-metadata">

**Author:** ![Knobbynobbes](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Knobbynobbes](https://forums.unrealengine.com/u/Knobbynobbes)\
**Post date:** [June 6, 2014, 1:16am UTC](https://forums.unrealengine.com/t/why-is-my-masked-material-not-casting-shadows/285028/3 "2014-06-06T01:16:12Z")

</div>

Yea, its definately set to masked.

---

<div class="post-metadata">

**Author:** ![Lovecraft\_K](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Lovecraft\_K](https://forums.unrealengine.com/u/Lovecraft_K)\
**Post date:** [June 8, 2014, 9:24pm UTC](https://forums.unrealengine.com/t/why-is-my-masked-material-not-casting-shadows/285028/4 "2014-06-08T21:24:03Z")

</div>

Hi Knobbynobbes -

Can you post a screenshot of your material setup?

Thank You

Eric Ketchum

---

<div class="post-metadata">

**Author:** ![Lovecraft\_K](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Lovecraft\_K](https://forums.unrealengine.com/u/Lovecraft_K)\
**Post date:** [June 11, 2014, 5:49pm UTC](https://forums.unrealengine.com/t/why-is-my-masked-material-not-casting-shadows/285028/5 "2014-06-11T17:49:32Z")

</div>

Hi Knobbynobbes -

I haven’t heard from you, so hopefully you have resolved the problem. I am going to make this question answered for tracking purposes, but if you are still having this problem or it reoccurs let us know

Thank You

Eric Ketchum

---

<div class="post-metadata">

**Author:** ![Sonic\_reducer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Sonic\_reducer](https://forums.unrealengine.com/u/Sonic_reducer)\
**Post date:** [December 16, 2018, 8:02pm UTC](https://forums.unrealengine.com/t/why-is-my-masked-material-not-casting-shadows/285028/6 "2018-12-16T20:02:41Z")

</div>

I know this is a really old post, but I am running into the same issue. Anyone have a solution to this?

---

<div class="post-metadata">

**Author:** ![PC-hris](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@PC-hris](https://forums.unrealengine.com/u/PC-hris)\
**Post date:** [March 8, 2019, 9:57am UTC](https://forums.unrealengine.com/t/why-is-my-masked-material-not-casting-shadows/285028/7 "2019-03-08T09:57:23Z")

</div>

Here’s someone else that was trying to figure it out:

> **[Masked material no shadows from directional light](https://forums.unrealengine.com/questions/352499/masked-material-no-shadows-from-directional-light.html)**
>
> I created for my player mesh a masked material which fades away if the camera is close to it. However I noticed that my mesh is only casting shadows from point or spotlights: I checked every lightning settings on my skeletal meshes but to no...

and this one seems to have any idea what’s going on (was linked to in answer from other link):

> **[Opacity Mask Shadow with Pixel Depth Problem](https://forums.unrealengine.com/questions/451958/opacity-mask-shadow-with-pixel-depth-problem-1.html)**
>
> Hi, I’m trying to achieve the same result of Uncharted 4 with the foliage so that the camera doesn’t clip with it. I did a material with a pixel depth node (even try the perInstanceFadeAmount with a different problem). The result I want is there as...

---

<div class="post-metadata">

**Author:** ![Sonic\_reducer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Sonic\_reducer](https://forums.unrealengine.com/u/Sonic_reducer)\
**Post date:** [March 15, 2019, 7:42pm UTC](https://forums.unrealengine.com/t/why-is-my-masked-material-not-casting-shadows/285028/8 "2019-03-15T19:42:34Z")

</div>

Thanks for the reply. I saw those posts as well, but I really do not know how I should go about appyling those solutions to my materials. If I add a custom node with the text “IsShadowDepthShader()” in it then the materials just become invisible. For now I will have to get used to working with dynamic lighting and cast my shadows with that.

---

<div class="post-metadata">

**Author:** ![DirSarki](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/dirsarki/32/88708_2.png) [@DirSarki](https://forums.unrealengine.com/u/DirSarki)\
**Post date:** [July 25, 2024, 12:23pm UTC](https://forums.unrealengine.com/t/why-is-my-masked-material-not-casting-shadows/285028/9 "2024-07-25T12:23:02Z")

</div>

I’m sorry to dig out this ancient post again.  
Obviously this “disfunctionality” with PixelDepth in relation with masked material is still existing.

Just want to let know (if others stumble across this post):  
There is a simple workaround. Just replacing the PixelDepth node with the following setup:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/6/5/065ebff066985eb3e2ea82de1ae79bf95d7f9930.png)
