Spine-Skeleton-PMA-Additive.shader 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. // Spine/Skeleton PMA Screen
  2. // - single color multiply tint
  3. // - unlit
  4. // - Premultiplied alpha Multiply blending
  5. // - No depth, no backface culling, no fog.
  6. // - ShadowCaster pass
  7. Shader "Spine/Blend Modes/Skeleton PMA Additive" {
  8. Properties {
  9. _Color ("Tint Color", Color) = (1,1,1,1)
  10. [NoScaleOffset] _MainTex ("MainTex", 2D) = "black" {}
  11. [Toggle(_STRAIGHT_ALPHA_INPUT)] _StraightAlphaInput("Straight Alpha Texture", Int) = 0
  12. _Cutoff ("Shadow alpha cutoff", Range(0,1)) = 0.1
  13. [HideInInspector] _StencilRef("Stencil Reference", Float) = 1.0
  14. [HideInInspector][Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp("Stencil Comparison", Float) = 8 // Set to Always as default
  15. // Outline properties are drawn via custom editor.
  16. [HideInInspector] _OutlineWidth("Outline Width", Range(0,8)) = 3.0
  17. [HideInInspector][MaterialToggle(_USE_SCREENSPACE_OUTLINE_WIDTH)] _UseScreenSpaceOutlineWidth("Width in Screen Space", Float) = 0
  18. [HideInInspector] _OutlineColor("Outline Color", Color) = (1,1,0,1)
  19. [HideInInspector] _OutlineReferenceTexWidth("Reference Texture Width", Int) = 1024
  20. [HideInInspector] _ThresholdEnd("Outline Threshold", Range(0,1)) = 0.25
  21. [HideInInspector] _OutlineSmoothness("Outline Smoothness", Range(0,1)) = 1.0
  22. [HideInInspector][MaterialToggle(_USE8NEIGHBOURHOOD_ON)] _Use8Neighbourhood("Sample 8 Neighbours", Float) = 1
  23. [HideInInspector] _OutlineOpaqueAlpha("Opaque Alpha", Range(0,1)) = 1.0
  24. [HideInInspector] _OutlineMipLevel("Outline Mip Level", Range(0,3)) = 0
  25. }
  26. SubShader {
  27. Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" }
  28. LOD 100
  29. Fog { Mode Off }
  30. Cull Off
  31. ZWrite Off
  32. Blend One One
  33. Lighting Off
  34. Stencil {
  35. Ref[_StencilRef]
  36. Comp[_StencilComp]
  37. Pass Keep
  38. }
  39. Pass {
  40. Name "Normal"
  41. CGPROGRAM
  42. #pragma vertex vert
  43. #pragma fragment frag
  44. #pragma shader_feature _ _STRAIGHT_ALPHA_INPUT
  45. #include "../CGIncludes/Spine-BlendModes-NormalPass.cginc"
  46. ENDCG
  47. }
  48. Pass {
  49. Name "Caster"
  50. Tags { "LightMode"="ShadowCaster" }
  51. Offset 1, 1
  52. ZWrite On
  53. ZTest LEqual
  54. CGPROGRAM
  55. #pragma vertex vert
  56. #pragma fragment frag
  57. #pragma multi_compile_shadowcaster
  58. #pragma fragmentoption ARB_precision_hint_fastest
  59. #include "../CGIncludes/Spine-BlendModes-ShadowCasterPass.cginc"
  60. ENDCG
  61. }
  62. }
  63. CustomEditor "SpineShaderWithOutlineGUI"
  64. }