R3F Contact shadows position


I noticed that the ContactShadows component of drei doesn’t work as expected.

I am able to set the position but it only works if the position if near 0 on y axes.

I already tried to adapt near/far but no success.

I created a sandbox that shows the problem: https://codesandbox.io/p/devbox/rw4g2w?file=%2Fsrc%2FApp.jsx%3A9%2C56

How can I fix that?


I set near to -2 and far to 2.8 and the shadow stays around. :slight_smile: hth

This doesn’t work if I increase/decrease the y position. Why does the position affect the shadow at all if the shoe moves the same way as the camera of ContactShadows if near/far is relative to the camera’s position?

I updated the sandbox: https://codesandbox.io/p/devbox/rw4g2w?file=%2Fsrc%2FApp.jsx%3A21%2C15


1 Like

That’s indeed the same problem I have. I wonder how this can be fixed.

This fixed the problem: fix: Enhance contact shadows by FarazzShaikh · Pull Request #1585 · pmndrs/drei · GitHub

1 Like