Merge pull request #2303 from pandamicro/next

Fix spine shared material texture lost issue
This commit is contained in:
pandamicro
2018-02-01 18:44:01 +08:00
committed by GitHub
@@ -71,12 +71,12 @@ function _getSlotMaterial (slot, tex, premultiAlpha) {
}
let key = tex.url + src + dst;
let material = _sharedMaterials[key];
let texImpl = tex.getImpl();
if (!material) {
material = new SpriteMaterial();
material.useModel = true;
// update texture
let renderTex = tex.getImpl();
material.texture = tex.getImpl();
material.texture = texImpl;
// update blend function
let pass = material._mainTech.passes[0];
pass.setBlend(
@@ -87,6 +87,9 @@ function _getSlotMaterial (slot, tex, premultiAlpha) {
);
_sharedMaterials[key] = material;
}
else if (material.texture !== texImpl) {
material.texture = texImpl;
}
return material;
}