Hi,
I found that method material.clone() does not copy material at all.
It doesn’t copy custom shader assigned to the source material, and does not copy list of parameters of source material (parameters of custom shader).
code form engine (playcanvas ver. 164.1):
Material.prototype._cloneInternal = function(clone) {
clone.name = this.name;
clone.id = id++;
clone.shader = null; // does not copy shader
clone.parameters = {}; // does not copy parameters
//...
}, Material.prototype.clone = function() {
var clone = new pc.Material;
this._cloneInternal(clone);
return clone
}
Now, every time i need to make copy of material with custom shader, i need copy all parameters and shader manualy from source materail. It’s not convenient.
Is it OK, or it’s a bug?