# "receive shadows" on each shadow generator vs on mesh

**URL:** <https://forum.babylonjs.com/t/receive-shadows-on-each-shadow-generator-vs-on-mesh/43870>\
**Category:** Questions\
**Created:** [September 5, 2023, 3:40pm UTC](https://forum.babylonjs.com/t/receive-shadows-on-each-shadow-generator-vs-on-mesh/43870 "2023-09-05T15:40:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tawibox](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/tawibox/32/22881_2.png) [@tawibox](https://forum.babylonjs.com/u/tawibox)\
**Post date:** [September 5, 2023, 3:40pm UTC](https://forum.babylonjs.com/t/receive-shadows-on-each-shadow-generator-vs-on-mesh/43870/1 "2023-09-05T15:40:10Z")

</div>

Hey folks,

Currently the `receiveShadows` property is under each mesh. So in that case, if there are multiple shadows casting on the same mesh, when we turn this property to `false`, all shadows on that mesh will be turned off altogether.

Just wondering is there a way to control shadow enabling separately for each shadow on the same mesh? This will give us more flexible controls on shadowing. I feel like if we can add a function called “`addShadowReceiver`” on each shadow generator it would be quite handy. If users don’t use this function the the shadow receive logic will be acting as what we currently have.

Here is my PG:

> **[Babylon.js Playground](https://playground.babylonjs.com/#1KF7V1%23195)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

Many thanks,  
Tawibox

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [September 5, 2023, 10:25pm UTC](https://forum.babylonjs.com/t/receive-shadows-on-each-shadow-generator-vs-on-mesh/43870/2 "2023-09-05T22:25:18Z")

</div>

The lighting system being already quite complex I would suggest you instead clone the lights and have one casting, one not casting.

You could then rely on light excludedMeshes or includedOnlyMeshes to control which meshes are impacted.

---

<div class="post-metadata">

**Author:** ![tawibox](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/tawibox/32/22881_2.png) [@tawibox](https://forum.babylonjs.com/u/tawibox)\
**Post date:** [September 5, 2023, 11:53pm UTC](https://forum.babylonjs.com/t/receive-shadows-on-each-shadow-generator-vs-on-mesh/43870/3 "2023-09-05T23:53:32Z")

</div>

Aha, this would work. That’s an awesome way to apply these funcs. Thank you so much @sebavan !!
