mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-22 18:26:12 +08:00
[ts][pixi-v8] Prevent rendering of attachments with alpha 0. See #2912.
This commit is contained in:
parent
5d5473ee9f
commit
c3ea9fd931
@ -658,32 +658,37 @@ export class Spine extends ViewContainer {
|
|||||||
const skeleton = slot.bone.skeleton;
|
const skeleton = slot.bone.skeleton;
|
||||||
const skeletonColor = skeleton.color;
|
const skeletonColor = skeleton.color;
|
||||||
const slotColor = slot.color;
|
const slotColor = slot.color;
|
||||||
|
|
||||||
const attachmentColor = attachment.color;
|
const attachmentColor = attachment.color;
|
||||||
|
const alpha = skeletonColor.a * slotColor.a * attachmentColor.a;
|
||||||
|
|
||||||
cacheData.color.set(
|
cacheData.color.set(
|
||||||
skeletonColor.r * slotColor.r * attachmentColor.r,
|
skeletonColor.r * slotColor.r * attachmentColor.r,
|
||||||
skeletonColor.g * slotColor.g * attachmentColor.g,
|
skeletonColor.g * slotColor.g * attachmentColor.g,
|
||||||
skeletonColor.b * slotColor.b * attachmentColor.b,
|
skeletonColor.b * slotColor.b * attachmentColor.b,
|
||||||
skeletonColor.a * slotColor.a * attachmentColor.a,
|
alpha,
|
||||||
);
|
);
|
||||||
|
|
||||||
if (slot.darkColor) {
|
if (this.alpha === 0 || alpha === 0) {
|
||||||
cacheData.darkColor.setFromColor(slot.darkColor);
|
cacheData.skipRender = true;
|
||||||
|
} else {
|
||||||
|
if (slot.darkColor) {
|
||||||
|
cacheData.darkColor.setFromColor(slot.darkColor);
|
||||||
|
}
|
||||||
|
|
||||||
|
cacheData.skipRender = cacheData.clipped = false;
|
||||||
|
|
||||||
|
const texture = attachment.region?.texture.texture || Texture.EMPTY;
|
||||||
|
|
||||||
|
if (cacheData.texture !== texture) {
|
||||||
|
cacheData.texture = texture;
|
||||||
|
this.spineTexturesDirty = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (clipper.isClipping()) {
|
||||||
|
this.updateClippingData(cacheData);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cacheData.skipRender = cacheData.clipped = false;
|
|
||||||
|
|
||||||
const texture = attachment.region?.texture.texture || Texture.EMPTY;
|
|
||||||
|
|
||||||
if (cacheData.texture !== texture) {
|
|
||||||
cacheData.texture = texture;
|
|
||||||
this.spineTexturesDirty = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (clipper.isClipping()) {
|
|
||||||
this.updateClippingData(cacheData);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if (attachment instanceof ClippingAttachment) {
|
else if (attachment instanceof ClippingAttachment) {
|
||||||
clipper.clipStart(slot, attachment);
|
clipper.clipStart(slot, attachment);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user