pixijs / spine

Pixi.js plugin that enables Spine support.
Other
570 stars 217 forks source link

Strange Rendering After Compression #531

Open kane-mason opened 1 year ago

kane-mason commented 1 year ago

I am really unsure whether this is a bug with pixi-spine or something we could be doing differently our side, but we have tried a multitude of solutions without any success. Hence i have come here for any sort of advice / suggestions / investigations / fixes.

The Problem (watch the centre animation carefully):

https://github.com/pixijs/spine/assets/23186829/10642aff-9840-4829-8393-f5bdabd4d9ca

The background:

The left animation: This is the source spine as exported directly from spine (for runtime 4.1.17). As you can see nothing wrong, animation plays out fine.

The middle amimation is the problem child. This animation is the source animation, with lossless compression applied by pingo (https://css-ig.net/pingo). At this point the png is still 32bit. You can see the flashes as the animation plays. If you observe the source sheet there is no evidence of this leading me to believe this has something to do with how it is rendered.

The right animation has the same compression as the middle animation, however it also has been further quantized by pnqquant (https://pngquant.org/). At this point the png is 8bit. Strangely, now the issue no longer occurs!

What we have tried:

  1. Removing masks within spine - no effect
  2. Removing blendModes within spine - no effect
  3. Exporting the spine over multiple smaller sheets - this works! Not ideal solution though as is a headache for the designers and results in multiple requests in the browser.
  4. Reducing compression level - Pingo has 4 lossless levels, s1 (least aggressive) - s4 (most aggressive). s1 does not show the issue for this particular animation, but affects other animations.

We still need to compress, we dont always want to use pngquant as the artifacting can be noticeably bad. So we still want to use the lossless options and have them render correctly.

I am able to share source files directly with a maintainer of this project if necessary.

kane-mason commented 12 months ago

Any thoughts here?

wpitallo commented 11 months ago

Having the same issue