InstancedMesh overlapping transparent ShaderMaterial issues

Hello everyone,

I’m facing some issues with a custom shader and InstancedMesh.
I made a fiddle to replicate my issue.

To make it simple, this instanced mesh are moving around and from time to time one will be in front of the other, and when this happen, depending on the render order I think, the opacity won’t work correctly.

I did find the renderOrder property of Object3d in the doc which seems to do the trick but I can’t find an equivalent for instancedMesh

Here is the fiddle
https://jsfiddle.net/alaric/hwuq6ocx/2/

Let me know if I can give more informations in order to help you help me !

Does it look better if you disable depth writing?

https://jsfiddle.net/ys5wap0b/

1 Like

Thank you @Mugen87 !

It seems to work perfectly in the fiddle and in my app !

I didn’t know about this depthWrite and I would never have thought of disabling it because of the name.
Thank you again !