mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-01 15:52:40 +08:00
Fix nearby mask being batched issue (#2833)
This commit is contained in:
@@ -178,6 +178,9 @@ let Mask = cc.Class({
|
||||
if (this._frontMaterial) {
|
||||
this._frontMaterial.alphaThreshold = this.alphaThreshold;
|
||||
this._frontMaterial.updateHash();
|
||||
this._endMaterial.alphaThreshold = this.alphaThreshold;
|
||||
this._endMaterial.updateHash();
|
||||
this._endMaterial._hash = -this._endMaterial._hash;
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -306,6 +309,8 @@ let Mask = cc.Class({
|
||||
}
|
||||
this._frontMaterial.updateHash();
|
||||
this._endMaterial.updateHash();
|
||||
// Avoid next up mask material to be batch with the exit one
|
||||
this._endMaterial._hash = -this._endMaterial._hash;
|
||||
this.markForRender(true);
|
||||
},
|
||||
|
||||
|
||||
@@ -136,7 +136,7 @@ let maskEndAssembler = {
|
||||
else {
|
||||
mask._material = mask._endMaterial;
|
||||
}
|
||||
let material = mask.getMaterial();
|
||||
let material = mask._material;
|
||||
|
||||
if (mask._type === Mask.Type.IMAGE_STENCIL) {
|
||||
let data = mask._renderData;
|
||||
|
||||
Reference in New Issue
Block a user