0
votes

Can anyone help me debug a glTF file? It looks ok in Don McCurdy's glTF viewer at https://gltf-viewer.donmccurdy.com/ (though it's pretty different from how it looks in Blender) but most of its pieces are missing when I use aframe to look at it: https://sgouros.com/scorpii/index1.html. The model is at https://sgouros.com/scorpii/data/scorpii3.glb

1

1 Answers

2
votes

This is happening because the transparent nodes of the model in most cases should have disabled writing to the depth buffer by their material.

Citing the Khronos wiki(or citing Don McCurdy citing the wiki):

The standard method for dealing with translucent objects ... involves disabling writes to the depth buffer and sorting transparent objects and/or polygons based on distance to the camera.

So you could just traverse the mesh and disable depthWrite for transparent objects:

model.traverse(node => {
    if (node.isMesh) {
           node.material.depthWrite = !node.material.transparent;
    }
});

like i did with the provided model in this glitch.