How to fix shadow shape

I’ve tried adding shadows to a couple of meshes (and their children meshes) but the shadow shapes are wrong or missing. Any help would be appreciated. Thanks!

There’s a repo from which this screenshot was taken, with code making the shadows here: 3d_sandbox/AppOne.ts at c07b09779cb6bcf88cad5534ec5e57d5acfdd670 · AJamesPhillips/3d_sandbox · GitHub

Hi @ajp,

Usually it indicates the resolution of the shadow is too low. It could be directional light is too far away from the ground, the resolution of shadow texture is too low, or the model is too small.

Can you try to move your directional light closer to the ground. E.g.

sun.position = new BABYLON.Vector3(20, 20, 20)

2 Likes

Thanks this worked. I’ve created a PR to add this to the Shadows trouble shooting docs: Add missing or incorrect shadow troubleshooting info by AJamesPhillips · Pull Request #500 · BabylonJS/Documentation · GitHub

1 Like

thanks a lot @ajp