First,I learned an example of the GLTFLoad ,then I used Blender to build a Model and used glTF-Blender-Exporter export gltf file. when i used GLTFLoad() to load the gltf file,why can’t load the texture. There is no error in the Console.I can find the texture Info .
var gltfLoader = new THREE.GLTFLoader();
gltfLoader.load( 'assset/test/testgltf1.gltf', function ( gltf ) {
gltf.scene.position.set(0,2,3);
scene.add( gltf.scene );
console.log(gltf.scene.children[0])
} );
GLTFLoader should fail with an error if it can’t find a texture — when you export from Blender, do you see the texture in the export folder? If not, probably double-check that your materials are configured in a way the exporter understands.
Also be sure to include an error callback when calling .load(), to be sure errors aren’t silenced:
.bin .gltf and texture all three files exported through blender are in the same path,i can load the model and no error in the Console . I don’t know WHY NOT show the texture.
I think you’ll need to share the files if you can. Ideally the four files shown above, as well as the original .blend file. If you can’t share those, could you open the .gltf file in a text editor and verify that the images are mentioned there?
Do you see the image in Blender? When I open the .blend file, I can see that there is supposed to be an image, but it isn’t visible in the 3D view, probably because it isn’t embedded in the .blend file. When I replace it with an image of my own, it exports correctly. Also, are you using KhronosGroup/glTF-Blender-Exporter, or Kupoman/blendergltf, to export?
Your geometry doesn’t have any UVs. I would suggest you try exporting with a different exporter, such as the KhronosGroup/glTF-Blender-Exporter, or make sure the exporter you are using is up to date.
The object loads completely white. There are six notes for the object (representing the parts)
Code:
MESH_PRIMITIVE_UNUSED_TEXCOORD
Message:
Material does not use texture coordinates sets with indices (0).
Pointer:
/meshes/0/primitives/0/material
Format: glTF 2.0
Generator: FBX converter by Facebook
Primitives: 5
The output from running FBX2glTF file.fbx is two directories:
file_out: which contains
file.gltf
buffer.bin
and
file.fbm: which contains
example.tif.
I was reading elsewhere that three.js might not be able to read the .tif format so I also saved this as a .png.
I can’t get the texture / image to load and need to know what the message was in the FBX GLTF debugger.
If anyone has any suggestions they’d be greatly appreciated.