is it possible to create a mesh that generates a shadow only but is actually not visible (only the shadow)?
Reasoning: I have many small meshes (>1000) that are very closed to each other. If the shadow is calculates for each of these small objects, it slows down everything.
Idea would be to have several (bigger) meshes that are not visible but generate the corresponding shadow.
We can avoid using an observer by setting the layerMask property instead so that the cube is not drawn by the active camera:
If you want the invisible object to still occlude other objects, you can use set the disableColorWrite property of the material to true instead of layerMask: