"receive shadows" on each shadow generator vs on mesh

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:

Many thanks,

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.

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