Yo @Deltakosh and @sebavan … I am having issues with Mesh Instances and OVERRIDING receive shadows.
I ask ChatGPT (before i started messing with mesh instances) if can have separate receiveShadows for each instance:
can babylonjs meshinstance receive shadows
ChatGPT said:
In Babylon.js, MeshInstance (specifically, InstancedMesh) can receive shadows, but you have to enable it properly.
Here's the key:
Each InstancedMesh inherits the receiveShadows and castShadows properties from its source mesh at creation time.
However, you can override instance.receiveShadows = true manually if needed.
But it not working right. Here are a couple of playgrounds:
Not showing shadows because Line 36 sets receiveShadows = false
even though the override for the instance at Line 42 is setting receiveShadows = true
Is Working If I Enable Shadows On Source Mesh At Line 36
Aren’t I supposed to be able to set receive shadows independent of the source mesh ?