The depth of PBRMaterial is wrong


Its visibility is 99, but it clearly rendered the back of the model first, which is incorrect. I imported the glb model with this pbr material, and I tried modifying all the options in the sidebar, but couldn’t solve the problem, including transparencyMode, alphaMode, disableDepthWrite, disableDepthWrite, etc.

Welcome aboard!

Your problem is that the mesh is transparent, because “Transparency mode” is set to “Alpha blend and test”. In that case, the depth buffer is not written by the mesh, so the triangles will be displayed in the order they appear in the mesh definition, which, depending on the camera position/rotation, may produce rendering artifacts.

I don’t think you need transparency for this mesh? If so, you should set the transparency mode to “Opaque”.

Note: visibility is a number from 0 to 1

1 Like