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:

b7774f521f24db774df5622b2762571c

And the link to codesandbox:
https://codesandbox.io/s/threejs-shadowmaterial-logarithmicdepthbuffer-rgzrph
(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!

1 Like

Hello @abgrac and welcome.
I have (probably) the same problem and have yet to find a solution.
Did you solve thre problem?

If anyone finds this, mugen has fixed the issue ShadowMaterial: render-order with logarithmicDepthBuffer is wrong · Issue #25515 · mrdoob/three.js · GitHub
should be in the next release r150 comming soon.

1 Like

Just saw the update, sorry I didn’t respond in time.
Great to know anyway! Good job thx