SpritesUnlit.shader 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. Shader "Spine/Sprite/Unlit"
  2. {
  3. Properties
  4. {
  5. _MainTex ("Main Texture", 2D) = "white" {}
  6. _Color ("Color", Color) = (1,1,1,1)
  7. [MaterialToggle] PixelSnap ("Pixel snap", Float) = 0
  8. _ZWrite ("Depth Write", Float) = 0.0
  9. _Cutoff ("Depth alpha cutoff", Range(0,1)) = 0.0
  10. _ShadowAlphaCutoff ("Shadow alpha cutoff", Range(0,1)) = 0.1
  11. _CustomRenderQueue ("Custom Render Queue", Float) = 0.0
  12. _OverlayColor ("Overlay Color", Color) = (0,0,0,0)
  13. _Hue("Hue", Range(-0.5,0.5)) = 0.0
  14. _Saturation("Saturation", Range(0,2)) = 1.0
  15. _Brightness("Brightness", Range(0,2)) = 1.0
  16. _BlendTex ("Blend Texture", 2D) = "white" {}
  17. _BlendAmount ("Blend", Range(0,1)) = 0.0
  18. [MaterialToggle(_TINT_BLACK_ON)] _TintBlack("Tint Black", Float) = 0
  19. _Black("Dark Color", Color) = (0,0,0,0)
  20. [HideInInspector] _SrcBlend ("__src", Float) = 1.0
  21. [HideInInspector] _DstBlend ("__dst", Float) = 0.0
  22. [HideInInspector] _RenderQueue ("__queue", Float) = 0.0
  23. [HideInInspector] _Cull ("__cull", Float) = 0.0
  24. [HideInInspector] _StencilRef("Stencil Reference", Float) = 1.0
  25. [HideInInspector][Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp("Stencil Comparison", Float) = 8 // Set to Always as default
  26. // Outline properties are drawn via custom editor.
  27. [HideInInspector] _OutlineWidth("Outline Width", Range(0,8)) = 3.0
  28. [HideInInspector][MaterialToggle(_USE_SCREENSPACE_OUTLINE_WIDTH)] _UseScreenSpaceOutlineWidth("Width in Screen Space", Float) = 0
  29. [HideInInspector] _OutlineColor("Outline Color", Color) = (1,1,0,1)
  30. [HideInInspector] _OutlineReferenceTexWidth("Reference Texture Width", Int) = 1024
  31. [HideInInspector] _ThresholdEnd("Outline Threshold", Range(0,1)) = 0.25
  32. [HideInInspector] _OutlineSmoothness("Outline Smoothness", Range(0,1)) = 1.0
  33. [HideInInspector][MaterialToggle(_USE8NEIGHBOURHOOD_ON)] _Use8Neighbourhood("Sample 8 Neighbours", Float) = 1
  34. [HideInInspector] _OutlineOpaqueAlpha("Opaque Alpha", Range(0,1)) = 1.0
  35. [HideInInspector] _OutlineMipLevel("Outline Mip Level", Range(0,3)) = 0
  36. }
  37. SubShader
  38. {
  39. Tags { "Queue"="Transparent" "RenderType"="Sprite" "AlphaDepth"="False" "CanUseSpriteAtlas"="True" "IgnoreProjector"="True" }
  40. LOD 100
  41. Stencil {
  42. Ref[_StencilRef]
  43. Comp[_StencilComp]
  44. Pass Keep
  45. }
  46. Pass
  47. {
  48. Name "Normal"
  49. Blend [_SrcBlend] [_DstBlend]
  50. Lighting Off
  51. ZWrite [_ZWrite]
  52. ZTest LEqual
  53. Cull [_Cull]
  54. Lighting Off
  55. CGPROGRAM
  56. #pragma shader_feature _ _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON _ALPHAPREMULTIPLY_VERTEX_ONLY _ADDITIVEBLEND _ADDITIVEBLEND_SOFT _MULTIPLYBLEND _MULTIPLYBLEND_X2
  57. #pragma shader_feature _ALPHA_CLIP
  58. #pragma shader_feature _TEXTURE_BLEND
  59. #pragma shader_feature _COLOR_ADJUST
  60. #pragma shader_feature _FOG
  61. #pragma shader_feature _TINT_BLACK_ON
  62. #pragma fragmentoption ARB_precision_hint_fastest
  63. #pragma multi_compile_fog
  64. #pragma multi_compile _ PIXELSNAP_ON
  65. #pragma vertex vert
  66. #pragma fragment frag
  67. #include "CGIncludes/SpriteUnlit.cginc"
  68. ENDCG
  69. }
  70. Pass
  71. {
  72. Name "ShadowCaster"
  73. Tags { "LightMode"="ShadowCaster" }
  74. Offset 1, 1
  75. Fog { Mode Off }
  76. ZWrite On
  77. ZTest LEqual
  78. Cull Off
  79. Lighting Off
  80. CGPROGRAM
  81. #pragma fragmentoption ARB_precision_hint_fastest
  82. #pragma multi_compile_shadowcaster
  83. #pragma multi_compile _ PIXELSNAP_ON
  84. #pragma vertex vert
  85. #pragma fragment frag
  86. #include "CGIncludes/SpriteShadows.cginc"
  87. ENDCG
  88. }
  89. }
  90. CustomEditor "SpineSpriteShaderGUI"
  91. }