GLTFLoader: Couldn't load texture textures/body_normal.jpeg

In my app,i have import GLTFLoader and load my .gltf file.The model appears normal but the image is error;


The framework I’m using is Vue and I’m sure my gltf path is correct,because i can open it in google network.Vue startup app is a server built locally.I want to ask what is the problem and how to solve it.
It’s my code.
微信图片_20230418165510

I suggest you first fix the following warning: Unknown extension “KHR_materials_pbrSpecularGlossiness”.

Please read the following post to understand the solution:

2 Likes

thx,I followed your advice and changed the material,now there is no error.
Can I ask another question: My picture is not displayed when it is imported. My image path is correct.

I solved the problem, I replaced the material

      loader.load('assets/scene2.gltf', function (obj) {
        obj.scene.traverse((child) => {
          if (child.isMesh&&child.material.map&&child.material.map.normalMap) {
            const texture = new THREE.TextureLoader().load('assets/' + child.material.map.normalMap);
            const material = new THREE.MeshBasicMaterial({ map: texture });
            child.material = material
          }
        })
        that.scene.add(obj.scene || obj.scenes[0])
        that.animate()
      }, function (e) {
        console.log(e)
      }, function (e) {
        console.log(e)
      })

Works like a charm. Thanks!