Hi, I’m trying to update the glossiness of a material. I have the texture updating but not the glossiness
I’ve tried a few ways including the one below but have not got this to work. Does anybody know the correct way to do this?
Thanks.
// initialize code called once per entity
Load.prototype.initialize = function() {
var self = this;
var image = new Image();
image.crossOrigin = "anonymous";
image.onload = function () {
var texture = new pc.Texture(self.app.graphicsDevice);
texture.setSource(image);
var material = self.entity.model.material;
material.diffuseMap = texture;
pc.app.root.findByName("Vase_3").model.meshInstances[1].material = material;
//pc.app.root.findByName("Vase_3").model.meshInstances[1].material.specular.setParameter("glossiness", 100);
//pc.app.root.findByName("Vase_3").model.meshInstances[1].material.specular.glossiness = 100;
//pc.app.root.findByName("Vase_3").model.meshInstances[1].material.specular.glossiness(100);
material.update();
};
image.src = myURL+myFolder+myImage;
};
// update code called every frame
Load.prototype.update = function(dt) {
};