pixelmeat Would it be possible to have a simpler version of this shader that, instead of modifying the texture color via a screen blending effect and an input color, just changed the color value of the texture to the same input color?
What do you mean by the last half of the sentence "just changed the color value of the texture to the same input color"? Do you want to output just the tint color in additive blend mode?
In general you can quite easily modify existing shaders if you just need to output a constant color. You can create a copy of the .shader
file, and rename the name in the first line of the file to your desired name to be displayed in the Materials shader property.
Then you can change the line #pragma fragment frag
which defines the following method from the included file "../../Include/Spine-Skeleton-ForwardPass-URP.hlsl"
to be used:
half4 frag(VertexOutput i) : SV_Target{
float4 texColor = tex2D(_MainTex, i.uv0);
#if defined(_ZWRITE)
clip(texColor.a * i.color.a - _Cutoff);
#endif
#if defined(_TINT_BLACK_ON)
return fragTintedColor(texColor, i.darkColor, i.color, _Color.a, _Black.a);
#else
#if defined(_STRAIGHT_ALPHA_INPUT)
texColor.rgb *= texColor.a;
#endif
return (texColor * i.color);
#endif
}
Now you can replace the used fragment program function like this in the .shader
file:
#pragma fragment yourFunction
and below the include statement add your function:
#include "../../Include/Spine-Skeleton-ForwardPass-URP.hlsl"
half4 yourFunction(VertexOutput i) : SV_Target {
float4 texColor = tex2D(_MainTex, i.uv0);
#if defined(_ZWRITE)
clip(texColor.a * i.color.a - _Cutoff);
#endif
return float4(i.color.rgb, texColor.a * i.color.a);
}