InstancedMesh
shadows don't show up correctly. It seems only one instance shadow is rendered always at the origin.
This online experiment shows the bug. Please look at the center of the tower to see the instance shadow:
https://yomboprime.github.io/instancedBricks/examples/instancedBricks.html
Instancing currently requires a customDepthMaterial
for proper shadow support.
See https://threejs.org/examples/webgl_buffergeometry_instancing_lambert.html.
I made sure shadows worked when implementing InstancedMesh
, I'll have a look.
@yomboprime could you turn the example into a jsfiddle?
@yomboprime could you turn the example into a jsfiddle?
I will.
BTW, it is the casting that doesn't work. The receiving of shadows by the instances is working right.
Oh, I think I know what's happening. Do they work if you hide the floor?
No need for the jsfiddle. I'm pretty sure I know what it is.
Oh, I already did it:
https://jsfiddle.net/cb1g24mq/
Note that I edited the fiddle link, it was wrong.
Oh, I think I know what's happening. Do they work if you hide the floor?
Yes, they do!
Should work now!
https://jsfiddle.net/mknxytf7/
Most helpful comment
I made sure shadows worked when implementing
InstancedMesh
, I'll have a look.