After creating a model using meshes in three.js, I noticed that some of the meshes clip when I move my camera with OrbitControls. The rendered image shows the issue:
https://i.sstatic.net/gBidu.gif
Researching online, I came across a solution suggesting to set the depthWrite
of the material to false
. However, implementing this caused all elements to display but broke the 3D effect (as this feature is mainly for overlaying elements in a 2D rendering). Here is the render with depthWrite
disabled:
https://i.sstatic.net/7crqF.gif
I have provided a minimal example showcasing the issue: https://codepen.io/theogiraudet/pen/WNZKPXx?editors=0110
Thank you for your assistance!