mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-01 07:42:38 +08:00
Merge pull request #2303 from pandamicro/next
Fix spine shared material texture lost issue
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user