# Cast shadow through alpha masked mesh & customDepthMaterial

**URL:** <https://discourse.threejs.org/t/cast-shadow-through-alpha-masked-mesh-customdepthmaterial/12760>\
**Category:** Questions\
**Tags:** shadows, alpha\
**Created:** [February 15, 2020, 10:35am UTC](https://discourse.threejs.org/t/cast-shadow-through-alpha-masked-mesh-customdepthmaterial/12760 "2020-02-15T10:35:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tru7](https://avatars.discourse-cdn.com/v4/letter/t/3e96dc/32.png) [@tru7](https://discourse.threejs.org/u/tru7)\
**Post date:** [February 15, 2020, 10:35am UTC](https://discourse.threejs.org/t/cast-shadow-through-alpha-masked-mesh-customdepthmaterial/12760/1 "2020-02-15T10:35:14Z")

</div>

I am trying to cast shadows through a plane with an alpha mask with the shadow catching the alpha shape.

Based on the sample of the simple cloth simulation [https://threejs.org/examples/webgl\_animation\_cloth.html](https://threejs.org/examples/webgl_animation_cloth.html) and other solutions to the same problem here, I’ve done this fiddle: [https://jsfiddle.net/truji7/gj7az9eo/69/](https://jsfiddle.net/truji7/gj7az9eo/69/)

But the cast shadow is still the whole solid mesh’s plane. I must be missing something. Any ideas?

---

<div class="post-metadata">

**Author:** ![tru7](https://avatars.discourse-cdn.com/v4/letter/t/3e96dc/32.png) [@tru7](https://discourse.threejs.org/u/tru7)\
**Post date:** [February 15, 2020, 12:27pm UTC](https://discourse.threejs.org/t/cast-shadow-through-alpha-masked-mesh-customdepthmaterial/12760/2 "2020-02-15T12:27:18Z")

</div>

Got the solution somewhere else, but for the case it’s useful to anyone: I am using a PointLight and PointLight needs a MeshDistanceMaterial as the customDistanceMaterial (rather than a MeshDepthMaterial)

---

<div class="post-metadata">

**Author:** ![ajp](https://avatars.discourse-cdn.com/v4/letter/a/c4cdca/32.png) [@ajp](https://discourse.threejs.org/u/ajp)\
**Post date:** [November 16, 2024, 6:46pm UTC](https://discourse.threejs.org/t/cast-shadow-through-alpha-masked-mesh-customdepthmaterial/12760/3 "2024-11-16T18:46:28Z")

</div>

> [@tru7](#):
>
> customDistanceMaterial

Thanks for this solution. For anyone else wanting to recreate this here’s the updated js fiddle: [ThreeJS Casting shadows through alpha masked mesh - JSFiddle - Code Playground](https://jsfiddle.net/86uk1d2v/) which also fixes the broken CDN link (for now, until the CDN breaks again 😉 )
