SpritesVertexLit-Outline.shader 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. // Outline shader variant of "Spine/Sprite/Vertex Lit"
  2. Shader "Spine/Outline/Sprite/Vertex Lit"
  3. {
  4. Properties
  5. {
  6. _MainTex ("Main Texture", 2D) = "white" {}
  7. _Color ("Color", Color) = (1,1,1,1)
  8. _BumpScale("Scale", Float) = 1.0
  9. _BumpMap ("Normal Map", 2D) = "bump" {}
  10. [MaterialToggle] PixelSnap ("Pixel snap", Float) = 0
  11. _EmissionColor("Color", Color) = (0,0,0,0)
  12. _EmissionMap("Emission", 2D) = "white" {}
  13. _EmissionPower("Emission Power", Float) = 2.0
  14. _Glossiness("Smoothness", Range(0.0, 1.0)) = 0.5
  15. _GlossMapScale("Smoothness Scale", Range(0.0, 1.0)) = 1.0
  16. [Gamma] _Metallic("Metallic", Range(0.0, 1.0)) = 0.0
  17. _MetallicGlossMap("Metallic", 2D) = "white" {}
  18. _DiffuseRamp ("Diffuse Ramp Texture", 2D) = "gray" {}
  19. _FixedNormal ("Fixed Normal", Vector) = (0,0,1,1)
  20. _ZWrite ("Depth Write", Float) = 0.0
  21. _Cutoff ("Depth alpha cutoff", Range(0,1)) = 0.0
  22. _ShadowAlphaCutoff ("Shadow alpha cutoff", Range(0,1)) = 0.1
  23. _CustomRenderQueue ("Custom Render Queue", Float) = 0.0
  24. _OverlayColor ("Overlay Color", Color) = (0,0,0,0)
  25. _Hue("Hue", Range(-0.5,0.5)) = 0.0
  26. _Saturation("Saturation", Range(0,2)) = 1.0
  27. _Brightness("Brightness", Range(0,2)) = 1.0
  28. _RimPower("Rim Power", Float) = 2.0
  29. _RimColor ("Rim Color", Color) = (1,1,1,1)
  30. _BlendTex ("Blend Texture", 2D) = "white" {}
  31. _BlendAmount ("Blend", Range(0,1)) = 0.0
  32. [HideInInspector] _SrcBlend ("__src", Float) = 1.0
  33. [HideInInspector] _DstBlend ("__dst", Float) = 0.0
  34. [HideInInspector] _RenderQueue ("__queue", Float) = 0.0
  35. [HideInInspector] _Cull ("__cull", Float) = 0.0
  36. [HideInInspector] _StencilRef("Stencil Reference", Float) = 1.0
  37. [HideInInspector][Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp("Stencil Comparison", Float) = 8 // Set to Always as default
  38. // Outline properties are drawn via custom editor.
  39. [HideInInspector] _OutlineWidth("Outline Width", Range(0,8)) = 3.0
  40. [HideInInspector] _OutlineColor("Outline Color", Color) = (1,1,0,1)
  41. [HideInInspector] _OutlineReferenceTexWidth("Reference Texture Width", Int) = 1024
  42. [HideInInspector] _ThresholdEnd("Outline Threshold", Range(0,1)) = 0.25
  43. [HideInInspector] _OutlineSmoothness("Outline Smoothness", Range(0,1)) = 1.0
  44. [HideInInspector][MaterialToggle(_USE8NEIGHBOURHOOD_ON)] _Use8Neighbourhood("Sample 8 Neighbours", Float) = 1
  45. [HideInInspector] _OutlineMipLevel("Outline Mip Level", Range(0,3)) = 0
  46. }
  47. SubShader
  48. {
  49. Tags { "Queue"="Transparent" "RenderType"="Sprite" "AlphaDepth"="False" "CanUseSpriteAtlas"="True" "IgnoreProjector"="True" }
  50. LOD 150
  51. Stencil {
  52. Ref[_StencilRef]
  53. Comp[_StencilComp]
  54. Pass Keep
  55. }
  56. UsePass "Spine/Outline/Skeleton/OUTLINE"
  57. UsePass "Spine/Sprite/Vertex Lit/VERTEX"
  58. UsePass "Spine/Sprite/Vertex Lit/SHADOWCASTER"
  59. }
  60. FallBack "Spine/Sprite/Vertex Lit"
  61. CustomEditor "SpineSpriteShaderGUI"
  62. }