Is there a way to toggle Mesh.receivesShadows per light?

Have a complex scene where some meshes need to receive shadows cast from one light, but then cast shadows for another light. However I run into issues with them self-shadowing off the second light which can’t be fixed just by messing with bias and near/far planes, so it’d be ideal if I can limit which light’s shadows certain meshes receive. However I haven’t found any mention of this being possible. Thought I’d check here.

Hey and welcome!
You can limit which light affects a mesh (but for both light and shadows) so maybe this is a way to do it ( Introduction To Lights | Babylon.js Documentation (babylonjs.com))

Other option: ShadowOnly Material | Babylon.js Documentation (babylonjs.com)

2 Likes