Applying materials to the model in the official model viewer is not a problem, but if you apply the texture yourself, it will become messy.
Set the texture in the official
Map the model yourself
The main code
BABYLON.SceneLoader.ImportMesh(“”, ‘./city/’, “city.glb”, scene,(newMeshes) => {
window.newMeshes = newMeshes;
newMeshes[0].scaling.setAll(8);
newMeshes.map(mesh => {
if(mesh.material){
const imageMaterial = new BABYLON.PBRMaterial(‘xxx’, scene);
mesh.material = imageMaterial;
mesh.material.albedoTexture = new BABYLON.Texture(“./city/bakedDay.jpg”,scene);
}
});
});