Hi,
I have to reopen this one. Have a look at this playground:
https://playground.babylonjs.com/#0K8EYN#181
Check the draw calls. The more cylinder (LOD) you see, the higher the draw calls. But if you assign a shadowcaster to it (uncomment the marked line), then the draw calls are really low and everything works fine.
So for instances with LOD to cast shadows in a draw call, one needs to set shadowcaster to each LOD object as well as the instance itself.
Wouldnt it be great to avoid shadow casting for objects that are within a certain distance to the camera while keeping the number of draw calls? So LOD 1 casts shadow and LOD 2 not?
Best,
Martin
Edit: Another observation: By setting box.isVisible=false; the shadow of the cylinder is staying on the ground. However the cylinder cannot be set invisible, since it would increase draw calls, too.