I believe shadowmaps use depth values, not colors, so it should be possible to have invisible meshes casting sadows.
I dont think there is a ready-to-use mechanism for mesh-shadow-swapping, so you will probably have to create and manage both models yourself.
In regards to making such object, I tested some material values and found 3.js ways to do it:
transparent: true, opacity: 0
transparent: true, colorWrite: false
alphaTest: 3. (Actually any value greater than 1 will do the trick. In the shader chunk code you can see that any pixel with alpha value below
ALPHATEST will be discarded and opaque values are 1 by default)
As far as which one is best… Im not sure
I would guess 3 - 2 - 1 is the most to least efficient due to alpha blending being pretty costly, but I can be wrong. Would love to hear an expert’s opinion on this.