源战役客户端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

80 lines
1.5 KiB

пре 1 месец
  1. Shader "Spine/Skeleton" {
  2. Properties {
  3. _Cutoff ("Shadow alpha cutoff", Range(0,1)) = 0.1
  4. [NoScaleOffset] _MainTex ("Main Texture", 2D) = "black" {}
  5. }
  6. SubShader {
  7. Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" "PreviewType"="Plane"}
  8. Fog { Mode Off }
  9. Cull Off
  10. ZWrite Off
  11. Blend One OneMinusSrcAlpha
  12. Lighting Off
  13. Pass {
  14. Fog { Mode Off }
  15. ColorMaterial AmbientAndDiffuse
  16. SetTexture [_MainTex] {
  17. Combine texture * primary
  18. }
  19. }
  20. Pass {
  21. Name "Caster"
  22. Tags { "LightMode"="ShadowCaster" }
  23. Offset 1, 1
  24. ZWrite On
  25. ZTest LEqual
  26. Fog { Mode Off }
  27. Cull Off
  28. Lighting Off
  29. CGPROGRAM
  30. #pragma vertex vert
  31. #pragma fragment frag
  32. #pragma multi_compile_shadowcaster
  33. #pragma fragmentoption ARB_precision_hint_fastest
  34. #include "UnityCG.cginc"
  35. sampler2D _MainTex;
  36. fixed _Cutoff;
  37. struct v2f {
  38. V2F_SHADOW_CASTER;
  39. float2 uv : TEXCOORD1;
  40. };
  41. v2f vert (appdata_base v) {
  42. v2f o;
  43. TRANSFER_SHADOW_CASTER(o)
  44. o.uv = v.texcoord;
  45. return o;
  46. }
  47. float4 frag (v2f i) : COLOR {
  48. fixed4 texcol = tex2D(_MainTex, i.uv);
  49. clip(texcol.a - _Cutoff);
  50. SHADOW_CASTER_FRAGMENT(i)
  51. }
  52. ENDCG
  53. }
  54. }
  55. SubShader {
  56. Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" }
  57. Cull Off
  58. ZWrite Off
  59. Blend One OneMinusSrcAlpha
  60. Lighting Off
  61. Pass {
  62. ColorMaterial AmbientAndDiffuse
  63. SetTexture [_MainTex] {
  64. Combine texture * primary DOUBLE, texture * primary
  65. }
  66. }
  67. }
  68. }