mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-06 15:24:55 +08:00
[unity] Fix Tint and TintBlack shaders ignoring alpha.
This commit is contained in:
parent
3f242450cf
commit
c7017067ea
@ -52,7 +52,7 @@ Shader "Spine/Skeleton Tint" {
|
||||
|
||||
float4 frag (VertexOutput i) : COLOR {
|
||||
float4 texColor = tex2D(_MainTex, i.uv);
|
||||
return (texColor * i.vertexColor) + float4(((1-texColor.rgb) * texColor.a * _Black.rgb), 0);
|
||||
return (texColor * i.vertexColor) + float4(((1-texColor.rgb) * _Black.rgb * texColor.a*_Color.a*i.vertexColor.a), 0);
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
|
||||
@ -110,7 +110,7 @@ Shader "Spine/SkeletonGraphic Tint Black (Premultiply Alpha)"
|
||||
clip (texColor.a - 0.001);
|
||||
#endif
|
||||
|
||||
return (texColor * IN.color) + float4(((1-texColor.rgb) * texColor.a * (_Black.rgb + float3(IN.uv1.r, IN.uv1.g, IN.uv2.r))), 0);
|
||||
return (texColor * IN.color) + float4(((1-texColor.rgb) * (_Black.rgb + float3(IN.uv1.r, IN.uv1.g, IN.uv2.r)) * texColor.a*_Color.a*i.vertexColor.a), 0);
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
|
||||
@ -61,7 +61,7 @@ Shader "Spine/Skeleton Tint Black" {
|
||||
|
||||
float4 frag (VertexOutput i) : COLOR {
|
||||
float4 texColor = tex2D(_MainTex, i.uv);
|
||||
return (texColor * i.vertexColor) + float4(((1-texColor.rgb) * texColor.a * (_Black.rgb + float3(i.uv1.r, i.uv1.g, i.uv2.r))), 0);
|
||||
return (texColor * i.vertexColor) + float4(((1-texColor.rgb) * (_Black.rgb + float3(i.uv1.r, i.uv1.g, i.uv2.r)) * texColor.a*_Color.a*i.vertexColor.a), 0);
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user