Shadows not displayed on a glb. model

Hi!

I am working with a single glb. landscape model with trees of which shadow I am trying to cast on the ground. However, I fail to produce any actual shadows on the ground.

Playground:
https://playground.babylonjs.com/#ZEYPU8

I have of course checked the documentation and attempted various solutions including and others on the tutorial section:
https://playground.babylonjs.com/#IFYDRS

For further info, the glft. is exported from Unity and converted to glb.
Your input is appreciated.

Like this :

4 Likes

Many thanks! Could you comment what’s the best way to achieve this for all the meshes (the trees and the rock)? Edit: I’ll answer my own question:
https://forum.babylonjs.com/t/is-there-a-shadowgenerator-getshadowmap-auto-add-all-meshes-in-scene-scene/318/2

Sorry for not commenting more.

Your concern was that receiveShadows=true was missing on the ground for the shadows to be cast on it.
Then on the mesh you getMeshByName ‘__ root __’ which was all the scene (ground too). You need to call the mesh (Tree) to add to the renderList of the shadow generator.

Open the inspector to see all the hierarchy of your glb scene

2 Likes