Spine-Special-Skeleton-Grayscale-Outline.shader 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // Outline shader variant of "Spine/Special/Skeleton Grayscale"
  2. Shader "Spine/Outline/Special/Skeleton Grayscale" {
  3. Properties {
  4. _GrayPhase ("Phase", Range(0, 1)) = 1
  5. [NoScaleOffset] _MainTex ("MainTex", 2D) = "white" {}
  6. _Cutoff ("Shadow alpha cutoff", Range(0,1)) = 0.1
  7. [Toggle(_STRAIGHT_ALPHA_INPUT)] _StraightAlphaInput("Straight Alpha Texture", Int) = 0
  8. [HideInInspector] _StencilRef("Stencil Reference", Float) = 1.0
  9. [HideInInspector][Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp("Stencil Comparison", Float) = 8 // Set to Always as default
  10. // Outline properties are drawn via custom editor.
  11. [HideInInspector] _OutlineWidth("Outline Width", Range(0,8)) = 3.0
  12. [HideInInspector][MaterialToggle(_USE_SCREENSPACE_OUTLINE_WIDTH)] _UseScreenSpaceOutlineWidth("Width in Screen Space", Float) = 0
  13. [HideInInspector] _OutlineColor("Outline Color", Color) = (1,1,0,1)
  14. [HideInInspector] _OutlineReferenceTexWidth("Reference Texture Width", Int) = 1024
  15. [HideInInspector] _ThresholdEnd("Outline Threshold", Range(0,1)) = 0.25
  16. [HideInInspector] _OutlineSmoothness("Outline Smoothness", Range(0,1)) = 1.0
  17. [HideInInspector][MaterialToggle(_USE8NEIGHBOURHOOD_ON)] _Use8Neighbourhood("Sample 8 Neighbours", Float) = 1
  18. [HideInInspector] _OutlineOpaqueAlpha("Opaque Alpha", Range(0,1)) = 1.0
  19. [HideInInspector] _OutlineMipLevel("Outline Mip Level", Range(0,3)) = 0
  20. }
  21. SubShader {
  22. Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" "PreviewType"="Plane" }
  23. Blend One OneMinusSrcAlpha
  24. Cull Off
  25. ZWrite Off
  26. Lighting Off
  27. Stencil {
  28. Ref[_StencilRef]
  29. Comp[_StencilComp]
  30. Pass Keep
  31. }
  32. UsePass "Spine/Outline/Skeleton/OUTLINE"
  33. UsePass "Spine/Special/Skeleton Grayscale/NORMAL"
  34. UsePass "Spine/Special/Skeleton Grayscale/CASTER"
  35. }
  36. FallBack "Spine/Special/Skeleton Grayscale"
  37. CustomEditor "SpineShaderWithOutlineGUI"
  38. }