Hello everyone,
i’m trying to use .basis textures in my project, and it works great (performance wise)!
loading regular emissiveTexture works fine, however, the loader prints an error, when i try to load an alpha-texture saying:
Uncaught (in promise) RuntimeError: Unable to load from assets/3d/gltf_moebel/moebel_reexport.gltf: /textures/3: TextureLoader failed to load data - Fallback texture was used
The (alpha) .basis-texture-file exists (all the emissiveTextures are getting loaded), so i assume, i’m doing something wrong with my loadingapproch?
this.loadMaterialPropertiesAsync = function (context, material, babylonMaterial) {
var promises = [];
if (material.emissiveTexture) {
promises.push(loader.loadTextureInfoAsync(context + "/emissiveTexture", material.emissiveTexture, function (babylonTexture) {
babylonMaterial.emissiveTexture = babylonTexture;
}));
}
else {
var pbrMetallicRoughness = material.pbrMetallicRoughness;
if (pbrMetallicRoughness) {
if (pbrMetallicRoughness.baseColorTexture) {
promises.push(loader.loadTextureInfoAsync(context + "/pbrMetallicRoughness/baseColorTexture", material.pbrMetallicRoughness.baseColorTexture, function (babylonTexture) {
babylonMaterial.diffuseTexture = babylonTexture;
}));
}
}
}
}
In the .glft the material is defined like so:
{
"alphaMode" : "BLEND",
"doubleSided" : true,
"name" : "moeblscreen16x9_rahmen_shadow",
"pbrMetallicRoughness" : {
"baseColorFactor" : [
0,
0,
0,
1
],
"baseColorTexture" : {
"index" : 1
},
"metallicFactor" : 0
}
},
when packing the .gltf as a .glb in blender with .jpg and .png textures everything works fine…
Can someone please tell me, what i’m doing wrong? Thanks alot!