Using ShadowMaterial with logarithmicDepthBuffer is affecting render-order

Hello all! It’s my first post, nice to meet the community.

I have a problem using ShadowMaterial and logarithmicDepthBuffer together, as the ShadowMaterial render order goes awry. Here’s a reproduction of the problem:


And the link to codesandbox:
(you can uncomment the logarithmicDepthBuffer line to see the expected result)

I already tried tweaking the renderOrder params of each (with sortObjects to false). Also tried with different materials, blending modes etc.

Do you guys know of any solution, or if I’m missing something? I do need to use logarithmicDepthBuffer in my scene, though.

Thanks very much in advance for the help!