I have two files one is before the ktx2 compression and second one is with the compression the file with ktx2 compression does not show the textures in blender and the file without the ktx2 compression shows the textures but with very low lods
What does it shows when you set the render mode to ‘Render’?
(top right corner of the 3d viewport, rightmost sphere icon)
strange… what happens if you visualize the glb in another viewer?
(for example here:https://gltf-viewer.donmccurdy.com/)
It seems the problem does not have to do with the textures, but it looks the mesh is missing the UV map…
In Blender, if you have imported the bgl file, you should have the textures in the data.images… if you can see the images correctly, then the problem is not the ktx2 encoding.
can you pin point where this icon located
In the Outliner, change the top selector to show ‘DataApi’
So, those ‘BakePBR*’ images are probably the texture files from the glb.
You can try to visualize them in the ImageEditor, just to see if they are ok…
But I suspect that the person who saved the glb in the first place, has forgotten to store the UV coordinates with the mesh.
otherwise is the glb file correct?
I have one more glb in which the textures are without the ktx2 compression in this the textures are visible but are of very lower lods.
At least the mesh is correct… but a glb file has many parts, and some might be corrupted, or their binary definitions may be wrong in the json part.
Test (7).glb (392.3 KB)
Test (8).glb (396.4 KB)
These are both the glb’s
Can you suggest from these is there any problem at the time of making the glb or is there a problem in the model itself
Test(7) has images inside, but each with 1x1 pixel size.
Test(8) has corrupted images with 256x256 pixels size.
Both meshes have UVmaps… so the mesh is ok.
I think the problem might be some wrong setting when the glb was created…
Are you the creator? (and if yes, can you try to save as a gltf instead?)
yes I am creating the glb from the babylon scene with the help of this code.
async function exportToGLB(scene) {
console.log(“glbExport”, scene);
scene.meshes = scene.meshes.filter((mesh) => {
return mesh.name !== “infinitePlane” && mesh.name !== “ground”;
});
scene.meshes.forEach((mesh) => {
mesh.name = mesh.id;
});
var options = {
shouldExportNode: function (node) {
return (
node.isEnabled() &&
node !== scene.activeCamera &&
node !== scene.lights[0]
);
},
includeCoordinateSystemConversionNodes: false,
};
try {
const response = await GLTF2Export.GLBAsync(scene, "Test", options);
console.log("Export successful:", response);
response.downloadFiles();
} catch (error) {
console.error("Error exporting GLB:", error);
}
}
I’m not familiar with the BabylonJS… Do you have the Babylon.Serializers installed (wild guess )?
yes I am using there functions to do the conversions.
Test.gltf (22.2 KB)
And this was the file generated I don’t know if it is correct or not
That last one gives me an error: ‘Test.bin missing’
If you have the mesh data and the textures, perhaps would be better to create the glb inside blender.
But the issue is that I want to create the gltf file from the scene itself on frontend