首页 > 解决方案 > ThreeJS GLTFExporter 不导出 PBR 材质贴图

问题描述

我有一个带有 PBR 材质的简单立方体。使用的贴图是颜色、金属度、粗糙度、凹凸。当我通过此代码导出场景时,导出的 glb 缺少除颜色之外的所有地图。这是 ThreeJS 中的错误吗?

e = new THREE.GLTFExporter();

e.parse(STAGE.scene.mesh, (glb) => {
   let blob = new Blob([glb], { type: "application/octet-stream" });
   let d = document.createElement('a');
       d.href = window.URL.createObjectURL(blob);
       d.download = "orbis.glb"
       document.body.appendChild(d);
       d.click();
       document.body.removeChild(d);
}, {binary: true});

标签: three.jsexportgltfpbr

解决方案


你应该使用不同的纹理。原因是 gltf 规范:


推荐阅读