Hi! I have a problem with changing material’s diffuse map texture via JS.
At start material have no texture, only diffuse color. After an event i wan’t to change diffuse map with texture.
I am using this code
var meshes = this.entity.model.meshInstances;
for(var i = 0; i < meshes.length; i++){
meshes[i].material.diffuseMap = this.Texture;
meshes[i].material.update();
}
this.entity.model.material.update();
When running this code, diffuse map changes, but it seems like it only use alpha channel of texture.
I’ve tried manualy set diffuseMapChannel to ‘rgb’ in code, but when I’d checked runtime with browser’s developer tools, it was set ‘rgb’ already.
What is the problem? What I do wrong?
Sorry for bad english.