Clipping issues with GLTF

When I visualise GLB model in Babylon, I get all kinds of issues with faces hiding or popping out through other faces. I tried Three.js based online viewers and everything seems fine.

I remember that in Three.js there was a flag which I had to set to do extra processing step, but I do not remeber which one it was.

Here is what I’m seeing:

Screen Shot 2022-03-14 at 1.24.31 pm

Here is the file:

https://easyupload.io/2yb3kn

SOLVED: the solution to these clipping issues is to set the depthPrepass on the material.

BABYLON.SceneLoader.ImportMesh("", "/", "tile_1.glb", scene, function (m) {
      m.forEach((mesh) => {
        if (mesh.material) {
          mesh.material.needDepthPrePass = true;
        }
      });
    });
3 Likes