gltf 文件在框架中呈现不正确
gltf file renders incorrectly in aframe
谁能帮我调试 glTF 文件?在 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
的 Don McCurdy 的 glTF 查看器中看起来不错
发生这种情况是因为模型的透明节点 in most cases should have 禁止通过其 material 写入深度缓冲区。
引用 Khronos wiki(或引用 Don McCurdy 引用维基):
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.
因此您可以只遍历网格并对透明对象禁用 depthWrite:
model.traverse(node => {
if (node.isMesh) {
node.material.depthWrite = !node.material.transparent;
}
});
就像我在 this glitch 中使用提供的模型所做的那样。
谁能帮我调试 glTF 文件?在 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
的 Don McCurdy 的 glTF 查看器中看起来不错发生这种情况是因为模型的透明节点 in most cases should have 禁止通过其 material 写入深度缓冲区。
引用 Khronos wiki(或引用 Don McCurdy 引用维基):
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.
因此您可以只遍历网格并对透明对象禁用 depthWrite:
model.traverse(node => {
if (node.isMesh) {
node.material.depthWrite = !node.material.transparent;
}
});
就像我在 this glitch 中使用提供的模型所做的那样。