mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 17:56:04 +08:00
Merge branch '3.7-beta' of https://github.com/EsotericSoftware/spine-runtimes into 3.7-beta
This commit is contained in:
commit
ef1e6de3e4
@ -1,4 +1,4 @@
|
|||||||
// - Unlit + no shadow
|
// - Unlit
|
||||||
// - Premultiplied Alpha Blending (Optional straight alpha input)
|
// - Premultiplied Alpha Blending (Optional straight alpha input)
|
||||||
// - Double-sided, no depth
|
// - Double-sided, no depth
|
||||||
|
|
||||||
@ -7,6 +7,7 @@ Shader "Spine/Skeleton Fill" {
|
|||||||
_FillColor ("FillColor", Color) = (1,1,1,1)
|
_FillColor ("FillColor", Color) = (1,1,1,1)
|
||||||
_FillPhase ("FillPhase", Range(0, 1)) = 0
|
_FillPhase ("FillPhase", Range(0, 1)) = 0
|
||||||
[NoScaleOffset] _MainTex ("MainTex", 2D) = "white" {}
|
[NoScaleOffset] _MainTex ("MainTex", 2D) = "white" {}
|
||||||
|
_Cutoff ("Shadow alpha cutoff", Range(0,1)) = 0.1
|
||||||
[Toggle(_STRAIGHT_ALPHA_INPUT)] _StraightAlphaInput("Straight Alpha Texture", Int) = 0
|
[Toggle(_STRAIGHT_ALPHA_INPUT)] _StraightAlphaInput("Straight Alpha Texture", Int) = 0
|
||||||
}
|
}
|
||||||
SubShader {
|
SubShader {
|
||||||
@ -59,6 +60,46 @@ Shader "Spine/Skeleton Fill" {
|
|||||||
}
|
}
|
||||||
ENDCG
|
ENDCG
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Pass {
|
||||||
|
Name "Caster"
|
||||||
|
Tags { "LightMode"="ShadowCaster" }
|
||||||
|
Offset 1, 1
|
||||||
|
ZWrite On
|
||||||
|
ZTest LEqual
|
||||||
|
|
||||||
|
Fog { Mode Off }
|
||||||
|
Cull Off
|
||||||
|
Lighting Off
|
||||||
|
|
||||||
|
CGPROGRAM
|
||||||
|
#pragma vertex vert
|
||||||
|
#pragma fragment frag
|
||||||
|
#pragma multi_compile_shadowcaster
|
||||||
|
#pragma fragmentoption ARB_precision_hint_fastest
|
||||||
|
#include "UnityCG.cginc"
|
||||||
|
sampler2D _MainTex;
|
||||||
|
fixed _Cutoff;
|
||||||
|
|
||||||
|
struct VertexOutput {
|
||||||
|
V2F_SHADOW_CASTER;
|
||||||
|
float2 uv : TEXCOORD1;
|
||||||
|
};
|
||||||
|
|
||||||
|
VertexOutput vert (appdata_base v) {
|
||||||
|
VertexOutput o;
|
||||||
|
o.uv = v.texcoord;
|
||||||
|
TRANSFER_SHADOW_CASTER(o)
|
||||||
|
return o;
|
||||||
|
}
|
||||||
|
|
||||||
|
float4 frag (VertexOutput i) : COLOR {
|
||||||
|
fixed4 texcol = tex2D(_MainTex, i.uv);
|
||||||
|
clip(texcol.a - _Cutoff);
|
||||||
|
SHADOW_CASTER_FRAGMENT(i)
|
||||||
|
}
|
||||||
|
ENDCG
|
||||||
|
}
|
||||||
}
|
}
|
||||||
FallBack "Diffuse"
|
FallBack "Diffuse"
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user