Spine-Skeleton-Lit-Outline.shader 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // Outline shader variant of "Spine/Skeleton Lit"
  2. Shader "Spine/Outline/Skeleton Lit" {
  3. Properties {
  4. _Cutoff ("Shadow alpha cutoff", Range(0,1)) = 0.1
  5. [NoScaleOffset] _MainTex ("Main Texture", 2D) = "black" {}
  6. [Toggle(_STRAIGHT_ALPHA_INPUT)] _StraightAlphaInput("Straight Alpha Texture", Int) = 0
  7. [Toggle(_DOUBLE_SIDED_LIGHTING)] _DoubleSidedLighting("Double-Sided Lighting", 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] _OutlineColor("Outline Color", Color) = (1,1,0,1)
  13. [HideInInspector] _OutlineReferenceTexWidth("Reference Texture Width", Int) = 1024
  14. [HideInInspector] _ThresholdEnd("Outline Threshold", Range(0,1)) = 0.25
  15. [HideInInspector] _OutlineSmoothness("Outline Smoothness", Range(0,1)) = 1.0
  16. [HideInInspector][MaterialToggle(_USE8NEIGHBOURHOOD_ON)] _Use8Neighbourhood("Sample 8 Neighbours", Float) = 1
  17. [HideInInspector] _OutlineMipLevel("Outline Mip Level", Range(0,3)) = 0
  18. }
  19. SubShader {
  20. Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" }
  21. LOD 100
  22. Stencil {
  23. Ref[_StencilRef]
  24. Comp[_StencilComp]
  25. Pass Keep
  26. }
  27. UsePass "Spine/Outline/Skeleton/OUTLINE"
  28. UsePass "Spine/Skeleton Lit/NORMAL"
  29. UsePass "Spine/Skeleton Lit/CASTER"
  30. }
  31. FallBack "Spine/Skeleton Lit"
  32. CustomEditor "SpineShaderWithOutlineGUI"
  33. }