Unity Version: 2020.3.39f1
Unity Color Space: Linear
Spine Version: 4.0.64
Spine-Unity Runtime Version: spine-unity-4.0-2022-09-26.unitypackage
Spine Color Space: Gamma
Our team has encountered a color space related issue.
When the artists in our team try to create some UI
effects using slot blending modes (e.g. Addtive
) in Spine, or using semi-transparent image resources. It would behave a bit differently in Spine
than in Unity
. We've determined that this is due to the Linear Color Space we're using in Unity, as we get consistent visual performance when trying to convert Color Space to Gamma. Additionally, I also tried to create some scenes in Unity where I tried to use Shader
's Blend
to implement the Addtive
blend mode.
In this sample scene I used a solid color image with color values (128,128,128,255) and as you can see I used the same material for both game objects, the blend mode of this material I defined in the Shader as Blend One One
to implement the Additive
blend mode. When I change the color space, it has an inconsistent color mixing result.
In fact, I understand that this is an inevitable result of inconsistencies in the color space. However, our team wanted to be compatible with the workflow differences between Unity and the art at a relatively small cost and looked to the Spine team for help and a solution.
So far we've tried a "buggy" solution (but in some scenarios it works well). The way we did it was to modify the shader code in the Spine-Unity Runtime to handle the slice shader return values of the Additive
shader in a wrong way. For example, we modified the Spine/SkeletonGraphic Additive
so that the final color obtained does a TargetToGammaSpace
operation.
This approach is definitely wrong, but algorithmically he does make the final blend result closer to what we expect, here's what we get after debugging it in our project
So our request was to get the same visual effects in Linear color space as in Spine. Unfortunately our technical director has indicated that Unity's color space cannot be easily modified, so we're stuck with this clunky approach to the problem. Would love to get help and advice from the Spine team and look forward to hearing from you.