• RuntimesUnity
  • Losing Color due to CanvasGroup-Compatible Setting for SkeletonGraphic

Hello again!
As we continue to develop our game, we've noticed cases where some of the SkeletonGraphics that we use for our dialogue system (strictly UI/Canvas based) lose saturation for certain colors/layers—specifically, blushing.

As a developer (not an animator), I assumed it was just an issue with perhaps some settings regarding the animation itself, but (owning a pro license) checking the .spine project and liaising with our animators resulted in no easy or known solution from what we could tell (correct us if we're wrong please!).

But, I took a look at the settings within Unity for the Spine/SkeletonGraphic shader settings and noticed that some of our portraits had the CanvasGroup Compatible setting checked, while others didn't. Running a quick test of this in-game (during testing) showed that this setting affects how saturated things like the blush are (as seen in the screenshots below). Is this an unknown bug, a new bug, or actually part of the intended functionality? We're currently using SPINE 4.1.

Thank you in advance!
Julian.

PS: For the time being, we'll be unchecking this setting as it would look weird to have so many blushing characters in our game with bruise-like marks 🤣

Related Discussions
...

@JulianRice Sorry to hear you're having troubles. Please note the following sentence in the documentation here.

"Any SkeletonGraphic component using this CanvasGroup compatible material needs to also have Advanced - PMA Vertex Colors disabled to avoid a double-darkening effect of semi-transparent parts."

Could you please check whether this resolves your issue?

In general you should only enable CanvasGroup compatible at a SkeletonGraphic material when you're placing the skeleton as child below a CanvasGroup with alpha (transparency) set to a value lower than 1.0.

    Harald
    Thanks for the quick response! I missed that line in the documentation, so thanks for pointing that out.

    Wow, I looked into disabling Advanced - PMA Vertex Colors in the SkeletonGraphic component and it looked like it worked. Thanks! ✅

    While I'm here, I just wanted to bring up one more strange color discrepancy I noticed when comparing the standard SkeletonGraphic displayed in Unity compared to how it's shown in the Spine App.

    What confuses me is that what I see in the Spine editor differs from what's being shown in the game/build. I know there are a lot of variables that go into affecting how things are displayed, but the rest of the colors (other than the semi-transparent red blush) are rendered fine, which has me stumbled!

    Should I make a new thread for this?
    Regards,
    Julian

      @JulianRice Since you're using Linear color space in Unity: Are you perhaps using (the default) Gamma color space in Spine? See the documentation below on how to switch the viewport color space in Spine:
      http://esotericsoftware.com/spine-settings#Color-management

      In general you might want to consider whether switching from Linear to Gamma color space in your Unity project would be better, as any blending will be quite unintuitive in Linear space and not what you're expecting from e.g. Photoshop (especially with very transparent pixels). Linear color space mainly makes sense when you need physically correct lighting computations at different angles and intensities, which is however quite often not needed at all in sprite-based games. See this rather recent conversation here.

      Harald @JulianRice Please note the following sentence in the documentation here.

      "Any SkeletonGraphic component using this CanvasGroup compatible material needs to also have Advanced - PMA Vertex Colors disabled to avoid a double-darkening effect of semi-transparent parts."

      Could you please check whether this resolves your issue?

      JulianRice Wow, I looked into disabling Advanced - PMA Vertex Colors in the SkeletonGraphic component and it looked like it worked. Thanks! ✅

      We have just added a warning that is displayed in the SkeletonGraphic Inspector when this problematic combination of settings is detected, hopefully this helps to avoid future problems down the road. New spine-unity 4.1 and 4.2-beta unitypackages are available for download here as usual:
      https://esotericsoftware.com/spine-unity-download

        7 mois plus tard

        Harald
        Sorry for the delayed response and thank you for pointing this out to me.

        I was able to select the settings you pointed out and got it to work pretty smoothly! While the colors weren't as purely red (for example, for the blush) compared to the SPINE editor / original PSD, I feel that it's close enough that it will work just fine. We've opted for Linear color space to work with 2D URP in our environments, hence the inability to easily swap to Gamma color space.

        Regards,
        Julian

          Glad to hear you've figured it out. Thanks for getting back to us.

          JulianRice While the colors weren't as purely red (for example, for the blush) compared to the SPINE editor / original PSD, I feel that it's close enough that it will work just fine.

          Please see the above posting, you would need to change the Spine and Photoshop settings to display blending in linear color space instead of gamma space to match the result in Unity when using linear color space there.

          JulianRice We've opted for Linear color space to work with 2D URP in our environments, hence the inability to easily swap to Gamma color space.

          I'm not sure I understood your sentence correctly, please note that 2D URP could be used with gamma color space as well. Just pointing that out in case you've meant that 2D URP requires linear color space.