Instanced meshes lose shadows?

I noticed when I enable GPU instancing the mesh can no longer cast or receive real time shadows. Is this expected?

Original Post on Discord

by user 300386587278049291

Hello @BMAN seems like shadow casting defaults to false and is not set to the threejs renderer correctly right now. Will add a fix for that to enable shadow casting if any of the assigned meshes has shadow casting (or receiving) enabled

Not sure if we should also handle the fact that some meshes might have it turned on and off (my current change does enable it for all of them, otherwise we would have to put them into separate draw calls which does a) complicate the setup and b) not sure if that’s expected by users - one could still just create multiple materials in that case)

Thanks! And I think enabling for all makes sense. Maybe issue a warning if some instanced meshes are marked inconsistently?

by user 300386587278049291