Spine-SkeletonGraphic-TintBlack-Outline.shader 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. // Outline shader variant of "Spine/SkeletonGraphic Tint Black"
  2. Shader "Spine/Outline/SkeletonGraphic Tint Black"
  3. {
  4. Properties
  5. {
  6. [PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {}
  7. [Toggle(_STRAIGHT_ALPHA_INPUT)] _StraightAlphaInput("Straight Alpha Texture", Int) = 0
  8. [Toggle(_CANVAS_GROUP_COMPATIBLE)] _CanvasGroupCompatible("CanvasGroup Compatible", Int) = 0
  9. _Color ("Tint", Color) = (1,1,1,1)
  10. _Black ("Black Point", Color) = (0,0,0,0)
  11. [HideInInspector][Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp ("Stencil Comparison", Float) = 8
  12. [HideInInspector] _Stencil ("Stencil ID", Float) = 0
  13. [HideInInspector][Enum(UnityEngine.Rendering.StencilOp)] _StencilOp ("Stencil Operation", Float) = 0
  14. [HideInInspector] _StencilWriteMask ("Stencil Write Mask", Float) = 255
  15. [HideInInspector] _StencilReadMask ("Stencil Read Mask", Float) = 255
  16. [HideInInspector] _ColorMask ("Color Mask", Float) = 15
  17. [Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0
  18. // Outline properties are drawn via custom editor.
  19. [HideInInspector] _OutlineWidth("Outline Width", Range(0,8)) = 3.0
  20. [HideInInspector] _OutlineColor("Outline Color", Color) = (1,1,0,1)
  21. [HideInInspector] _OutlineReferenceTexWidth("Reference Texture Width", Int) = 1024
  22. [HideInInspector] _ThresholdEnd("Outline Threshold", Range(0,1)) = 0.25
  23. [HideInInspector] _OutlineSmoothness("Outline Smoothness", Range(0,1)) = 1.0
  24. [HideInInspector][MaterialToggle(_USE8NEIGHBOURHOOD_ON)] _Use8Neighbourhood("Sample 8 Neighbours", Float) = 1
  25. [HideInInspector] _OutlineMipLevel("Outline Mip Level", Range(0,3)) = 0
  26. }
  27. SubShader
  28. {
  29. Tags
  30. {
  31. "Queue"="Transparent"
  32. "IgnoreProjector"="True"
  33. "RenderType"="Transparent"
  34. "PreviewType"="Plane"
  35. "CanUseSpriteAtlas"="True"
  36. }
  37. Stencil
  38. {
  39. Ref [_Stencil]
  40. Comp [_StencilComp]
  41. Pass [_StencilOp]
  42. ReadMask [_StencilReadMask]
  43. WriteMask [_StencilWriteMask]
  44. }
  45. Cull Off
  46. Lighting Off
  47. ZWrite Off
  48. ZTest [unity_GUIZTestMode]
  49. Fog { Mode Off }
  50. Blend One OneMinusSrcAlpha
  51. ColorMask [_ColorMask]
  52. UsePass "Spine/Outline/SkeletonGraphic/OUTLINE"
  53. UsePass "Spine/SkeletonGraphic Tint Black/NORMAL"
  54. }
  55. FallBack "Spine/SkeletonGraphic Tint Black"
  56. CustomEditor "SpineShaderWithOutlineGUI"
  57. }