As title says, when I set up a skeleton to use a the Spine/Skeleton Tint shader, my invisible parts become visible when the skeleton is tinted.

Normal:

With tint:

Is there anything I can do to avoid this? My goal is to have the skeleton flash white for a brief moment then return to normal appearance.

    Related Discussions
    ...

    This is my code

    MaterialPropertyBlock block = new MaterialPropertyBlock();
    block.SetColor("_Black", Color.red);
    spine.GetComponent<MeshRenderer>().SetPropertyBlock(block);

    NA-45 As title says, when I set up a skeleton to use a the Spine/Skeleton Tint shader, my invisible parts become visible when the skeleton is tinted.

    Thanks for reporting and sorry for the troubles! This behaviour is actually a bug which seems to have slipped through for quite some time.

    I've created an issue ticket here:
    EsotericSoftware/spine-runtimes2457
    We will let you know once we've published a bugfix. This fix will however only be committed to the 4.2-beta branch, as it's a risky breaking change which might break existing projects which utilize this bug as a feature.

    @NA-45 We've just pushed a bugfix commit to the 4.2-beta branch.
    New 4.2-beta spine-unity and Spine URP Shaders UPM packages have been released:
    https://esotericsoftware.com/spine-unity-download
    As mentioned above, please note that this bugfix will not be ported to 4.1 since it might break existing projects.

    If you're on 4.1, you can integrate the following change into your own local 4.1 installation:
    EsotericSoftware/spine-runtimes6812160
    All that's needed is to replace the following line in the include file Spine-Skeleton-Tint-Common.cginc:
    Replace line 9 (in the current repository) from:

    float3 texDarkColor = (texColor.a - texColor.rgb);

    with

    float3 texDarkColor = max(0.0, a - texColor.rgb);

    This file is located in Spine\Runtime\spine-unity\Shaders\CGIncludes.

    a month later

    @NA-45 We discovered that the previous fix was incorrect (breaking behaviour at other tint black shaders at some parameter combinations). We're sorry for the inconvenience! We have just published a correct fix for the issue.

    If you want to include the proper fix in your project, you can revert the change from
    float3 texDarkColor = (texColor.a - texColor.rgb);
    to
    float3 texDarkColor = max(0.0, a - texColor.rgb);

    Instead if you're using the shader Shaders/Spine-Skeleton-TintBlack.shader, replace the line
    o.darkColor = GammaToTargetSpace(float3(v.uv1.r, v.uv1.g, v.uv2.r)) + _Black.rgb;
    with
    o.darkColor = GammaToTargetSpace(float3(v.uv1.r, v.uv1.g, v.uv2.r))
    + (_Black.rgb * v.vertexColor.a);

    so that _Black.rgb is multiplied by vertex color alpha before being added.

    If you're using Shaders/Spine-Skeleton-Tint.shader, replace
    return fragTintedColor(texColor, _Black.rgb, i.vertexColor, _Color.a, _Black.a);
    with
    return fragTintedColor(texColor, _Black.rgb * i.vertexColor.a, i.vertexColor, _Color.a, _Black.a);

    The same applies at every occurance of _Black.rgb in any shader, so also to URP shaders. Please see the diff of the commit (skip the Materials sections) for details:
    EsotericSoftware/spine-runtimesf4c0f64

    2 months later