# Shadow provide by transparency texture

**URL:** <https://discourse.threejs.org/t/shadow-provide-by-transparency-texture/25678>\
**Category:** Questions\
**Tags:** materials\
**Created:** [April 25, 2021, 3:21pm UTC](https://discourse.threejs.org/t/shadow-provide-by-transparency-texture/25678 "2021-04-25T15:21:56Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![elysium11](https://avatars.discourse-cdn.com/v4/letter/e/8e7dd6/32.png) [@elysium11](https://discourse.threejs.org/u/elysium11)\
**Post date:** [April 30, 2021, 3:31pm UTC](https://discourse.threejs.org/t/shadow-provide-by-transparency-texture/25678/2 "2021-04-30T15:31:01Z")

</div>

Hello ,

i found the solution here [Cast shadow through alpha masked mesh & customDepthMaterial](https://discourse.threejs.org/t/cast-shadow-through-alpha-masked-mesh-customdepthmaterial/12760)

the solution is to use MeshDistanceMaterial instead of MeshDepthMaterial cause i use PointLight so the code is

```
 var aa=scene.getObjectByName('serre36') ;
var bb = aa.children[3] ;
  var cc= bb.material;
bb.customDistanceMaterial = new THREE.MeshDistanceMaterial( {
			     map: cc.map, // use map provide by blender 
				alphaTest: 0.5
			} );

```

work very well see result

 ![shadow_texture](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/b/8/b8b16f5e1127568ef687601ff27defd1b01faf62.jpeg)

---

_[View the full topic](https://discourse.threejs.org/t/shadow-provide-by-transparency-texture/25678)._
