When loading a specific GLB model using draco decoder, the model is loaded already in color, as if it has material with a diffuse map. However, there is no diffusion map on the material itself. If the material is taken away, or any other is used, the appearance of the model does not change in any way.
I am attaching a link to a test project.
I would be grateful for an explanation of the reason for this behavior. Maybe it’s an engine bug, or I’m doing something wrong
Here is the code with which I try to change the look of the model:
//here I load the model
const blob = new Blob([this.file.resource]);
const url = window.URL.createObjectURL(blob);
this.app.assets.loadFromUrlAndFilename(url, "model.glb", "container", (err, asset) => {
const entity = new pc.Entity();
entity.addComponent("model", {
type: "asset",
asset: asset.resource.model,
});
//here I add new entity with needed model to hierarchy
this.entity.addChild(entity);
this.entity.children[0].setLocalScale(0.01, 0.01, 0.01);
//here I create a new material with a red diffuse for clarity
let newMat = new pc.StandardMaterial();
newMat.diffuse = new pc.Color(1, 0, 0);
//here I apply new material to my model
this.entity.children[0].model.material = newMat;
this.entity.children[0].model.material.update();
});
As a result, nothing happens.
Also, nothing happens if I try to change something in the material with which the model is initialized or if I just take the material from the model (set to null)