SpritesUnlit-Outline.shader 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. // Outline shader variant of "Spine/Sprite/Unlit"
  2. Shader "Spine/Outline/Sprite/Unlit"
  3. {
  4. Properties
  5. {
  6. _MainTex ("Main Texture", 2D) = "white" {}
  7. _Color ("Color", Color) = (1,1,1,1)
  8. [MaterialToggle] PixelSnap ("Pixel snap", Float) = 0
  9. _ZWrite ("Depth Write", Float) = 0.0
  10. _Cutoff ("Depth alpha cutoff", Range(0,1)) = 0.0
  11. _ShadowAlphaCutoff ("Shadow alpha cutoff", Range(0,1)) = 0.1
  12. _CustomRenderQueue ("Custom Render Queue", Float) = 0.0
  13. _OverlayColor ("Overlay Color", Color) = (0,0,0,0)
  14. _Hue("Hue", Range(-0.5,0.5)) = 0.0
  15. _Saturation("Saturation", Range(0,2)) = 1.0
  16. _Brightness("Brightness", Range(0,2)) = 1.0
  17. _BlendTex ("Blend Texture", 2D) = "white" {}
  18. _BlendAmount ("Blend", Range(0,1)) = 0.0
  19. [HideInInspector] _SrcBlend ("__src", Float) = 1.0
  20. [HideInInspector] _DstBlend ("__dst", Float) = 0.0
  21. [HideInInspector] _RenderQueue ("__queue", Float) = 0.0
  22. [HideInInspector] _Cull ("__cull", Float) = 0.0
  23. [HideInInspector] _StencilRef("Stencil Reference", Float) = 1.0
  24. [HideInInspector][Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp("Stencil Comparison", Float) = 8 // Set to Always as default
  25. // Outline properties are drawn via custom editor.
  26. [HideInInspector] _OutlineWidth("Outline Width", Range(0,8)) = 3.0
  27. [HideInInspector] _OutlineColor("Outline Color", Color) = (1,1,0,1)
  28. [HideInInspector] _OutlineReferenceTexWidth("Reference Texture Width", Int) = 1024
  29. [HideInInspector] _ThresholdEnd("Outline Threshold", Range(0,1)) = 0.25
  30. [HideInInspector] _OutlineSmoothness("Outline Smoothness", Range(0,1)) = 1.0
  31. [HideInInspector][MaterialToggle(_USE8NEIGHBOURHOOD_ON)] _Use8Neighbourhood("Sample 8 Neighbours", Float) = 1
  32. [HideInInspector] _OutlineMipLevel("Outline Mip Level", Range(0,3)) = 0
  33. }
  34. SubShader
  35. {
  36. Tags { "Queue"="Transparent" "RenderType"="Sprite" "AlphaDepth"="False" "CanUseSpriteAtlas"="True" "IgnoreProjector"="True" }
  37. LOD 100
  38. Stencil {
  39. Ref[_StencilRef]
  40. Comp[_StencilComp]
  41. Pass Keep
  42. }
  43. UsePass "Spine/Outline/Skeleton/OUTLINE"
  44. UsePass "Spine/Sprite/Unlit/NORMAL"
  45. UsePass "Spine/Sprite/Unlit/SHADOWCASTER"
  46. }
  47. FallBack "Spine/Sprite/Unlit"
  48. CustomEditor "SpineSpriteShaderGUI"
  49. }