SpritesUnlit.shader 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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. [HideInInspector] _SrcBlend ("__src", Float) = 1.0
  19. [HideInInspector] _DstBlend ("__dst", Float) = 0.0
  20. [HideInInspector] _RenderQueue ("__queue", Float) = 0.0
  21. [HideInInspector] _Cull ("__cull", Float) = 0.0
  22. [HideInInspector] _StencilRef("Stencil Reference", Float) = 1.0
  23. [HideInInspector][Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp("Stencil Comparison", Float) = 8 // Set to Always as default
  24. // Outline properties are drawn via custom editor.
  25. [HideInInspector] _OutlineWidth("Outline Width", Range(0,8)) = 3.0
  26. [HideInInspector] _OutlineColor("Outline Color", Color) = (1,1,0,1)
  27. [HideInInspector] _OutlineReferenceTexWidth("Reference Texture Width", Int) = 1024
  28. [HideInInspector] _ThresholdEnd("Outline Threshold", Range(0,1)) = 0.25
  29. [HideInInspector] _OutlineSmoothness("Outline Smoothness", Range(0,1)) = 1.0
  30. [HideInInspector][MaterialToggle(_USE8NEIGHBOURHOOD_ON)] _Use8Neighbourhood("Sample 8 Neighbours", Float) = 1
  31. [HideInInspector] _OutlineMipLevel("Outline Mip Level", Range(0,3)) = 0
  32. }
  33. SubShader
  34. {
  35. Tags { "Queue"="Transparent" "RenderType"="Sprite" "AlphaDepth"="False" "CanUseSpriteAtlas"="True" "IgnoreProjector"="True" }
  36. LOD 100
  37. Stencil {
  38. Ref[_StencilRef]
  39. Comp[_StencilComp]
  40. Pass Keep
  41. }
  42. Pass
  43. {
  44. Name "Normal"
  45. Blend [_SrcBlend] [_DstBlend]
  46. Lighting Off
  47. ZWrite [_ZWrite]
  48. ZTest LEqual
  49. Cull [_Cull]
  50. Lighting Off
  51. CGPROGRAM
  52. #pragma shader_feature _ _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON _ADDITIVEBLEND _ADDITIVEBLEND_SOFT _MULTIPLYBLEND _MULTIPLYBLEND_X2
  53. #pragma shader_feature _ALPHA_CLIP
  54. #pragma shader_feature _TEXTURE_BLEND
  55. #pragma shader_feature _COLOR_ADJUST
  56. #pragma shader_feature _FOG
  57. #pragma fragmentoption ARB_precision_hint_fastest
  58. #pragma multi_compile_fog
  59. #pragma multi_compile _ PIXELSNAP_ON
  60. #pragma multi_compile _ ETC1_EXTERNAL_ALPHA
  61. #pragma vertex vert
  62. #pragma fragment frag
  63. #include "CGIncludes/SpriteUnlit.cginc"
  64. ENDCG
  65. }
  66. Pass
  67. {
  68. Name "ShadowCaster"
  69. Tags { "LightMode"="ShadowCaster" }
  70. Offset 1, 1
  71. Fog { Mode Off }
  72. ZWrite On
  73. ZTest LEqual
  74. Cull Off
  75. Lighting Off
  76. CGPROGRAM
  77. #pragma fragmentoption ARB_precision_hint_fastest
  78. #pragma multi_compile_shadowcaster
  79. #pragma multi_compile _ PIXELSNAP_ON
  80. #pragma multi_compile _ ETC1_EXTERNAL_ALPHA
  81. #pragma vertex vert
  82. #pragma fragment frag
  83. #include "CGIncludes/SpriteShadows.cginc"
  84. ENDCG
  85. }
  86. }
  87. CustomEditor "SpineSpriteShaderGUI"
  88. }