mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[unity] Add shadow to Skeleton Fill shader.
This commit is contained in:
parent
dd888a356e
commit
6da58244f6
@ -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
|
||||||
|
|
||||||
@ -59,6 +59,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