Hi, I am developing a scene where I am using glb models. I need my models to render shadows upon subjecting to light.
I achieved shadows for model. But, the problem I am facing is shadows are not being rendered when I am using the same code for two or more models.
This is what I have achieved so far…
I am using
- const shadowGenerator = new BABYLON.ShadowGenerator(1024, light);
- ground.receiveShadows= true;
- shadowGenerator.addShadowCaster(meshes[0], true);
3rd line I used to which model I want the shadows to be displayed.
I am using the same method for other models in my scene. But, only one of them is working fine. Means, if I write the same code for two models, only one model’s shadow is being displayed.
Note: I am using directionalLight.
Any help is appreciated. Thanks in advance