jabuwu / bevy_spine

A Bevy plugin for Spine
https://docs.rs/bevy_spine
Other
84 stars 5 forks source link

Spine Slot Tint Black #18

Closed dt665m closed 6 months ago

dt665m commented 6 months ago

Does the current version support this feature? We have some spines using the tint black color space that isn't showing up in the bevy_spine engine. If not, I'm happy to try and add it with some guidance.

jabuwu commented 6 months ago

Can you provide an example file? It should support it

jabuwu commented 6 months ago

Sorry, I posted my comment prematurely. I tried and it does seem to be broken on latest bevy_spine. I'll see if it's something simple

jabuwu commented 6 months ago

This is a weird situation where I'm not sure how it ever worked before. You can see the PR, its a simple fix #19

Maybe it's been broken for a while and I didn't notice.

If you're able to confirm this fixes your issue, please let me know!

dt665m commented 6 months ago

@jabuwu I thought that was going to fix it as well but I've been playing with this in my own fork and this only half fixes it. The dark part in our animation's timeline is transitioning the alpha incorrectly. I can share with you our spine files privately because it is proprietary but we temporarily found a fix by using the example's Custom Material. Verbatim. So I'm still digging around to see exactly what it is that causes the incorrect alpha transitions (for the dark tint).

If you would like to see the spine project, let me know where/how to share. I basically did the same thing here https://github.com/dt665m/bevy_spine/tree/fix/shader-vertex-dark-colors

jabuwu commented 6 months ago

I'm not sure I understand what you mean. It works using this example? https://github.com/jabuwu/bevy_spine/blob/main/examples/custom_material.rs

Does the file look correct in this rusty_spine example? https://github.com/jabuwu/rusty_spine/blob/main/examples/miniquad.rs

You can easily change the loaded file here: https://github.com/jabuwu/rusty_spine/blob/7c247022f109c5d065a1268fcb614572654e7cd0/examples/miniquad.rs#L454-L464

It's not uncommon that the Spine C runtime has bugs of its own, as I've had to submit a few issues over there while working on this project. If it looks correct in the rusty_spine example, then we can rule that out, and I'm back to thinking its a simple problem somewhere in bevy_spine.

dt665m commented 6 months ago

@jabuwu I spoke too soon. Yes using the custom_material example, the file looks "closer" to what it looks like in the spine editor but it is still wrong in subtle ways.

We tried replacing the spine-ts phaser example with our spine export and it looks correct. I'll try it with the miniquad example. My guess is there is something weird with the BlendMode settings for the shader chosen for our export spine. Let me get back to you on using the miniquad one to see if it renders correctly.

dt665m commented 6 months ago

The miniquad one is showing the same issues as the shader fix branch that you and I have done. I can share the spines with you or make a recording. It works fine in spine-ts/phaser in the main spine-runtimes repository

jabuwu commented 6 months ago

If the problem persists in rusty_spine, then I would continue up the chain, and try running in spine-c sfml. My work was based off of this (official) example code. If it doesn't work correctly there, then we'll need to consult Esoteric Software for support.

I'm happy to help you with all of this. My Discord username is on my Github profile, or you can email me at jabu@gx.ag

dt665m commented 6 months ago

dazzle-spines

I'll try to run it with one of the examples that uses spine-c after this. Here is a recording of the rusty-spine+macroquad vs the spine-ts/phaser

dt665m commented 6 months ago

Some news... SFML doesn't exhibit the backward alpha tweening in the dark channel, but it's also missing some other animations. I could be missing some settings somewhere but I just copied the code from the rest of the examples.

dazzle-spines-sfml

dt665m commented 6 months ago

For the Bevy-spine version, we were able to get it to look "right" if we hacked the animation colors fix_hack

Not sure if this helps any.

dt665m commented 6 months ago

@jabuwu made a PR for a fix that works for me