Spine-Skeleton-Lit-ZWrite-Outline.shader 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // Outline shader variant of "Spine/Skeleton Lit ZWrite"
  2. Shader "Spine/Outline/Skeleton Lit ZWrite" {
  3. Properties {
  4. _Cutoff ("Depth alpha cutoff", Range(0,1)) = 0.1
  5. _ShadowAlphaCutoff ("Shadow alpha cutoff", Range(0,1)) = 0.1
  6. [NoScaleOffset] _MainTex ("Main Texture", 2D) = "black" {}
  7. [Toggle(_STRAIGHT_ALPHA_INPUT)] _StraightAlphaInput("Straight Alpha Texture", Int) = 0
  8. [Toggle(_DOUBLE_SIDED_LIGHTING)] _DoubleSidedLighting("Double-Sided Lighting", Int) = 0
  9. [HideInInspector] _StencilRef("Stencil Reference", Float) = 1.0
  10. [HideInInspector][Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp("Stencil Comparison", Float) = 8 // Set to Always as default
  11. // Outline properties are drawn via custom editor.
  12. [HideInInspector] _OutlineWidth("Outline Width", Range(0,8)) = 3.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] _OutlineMipLevel("Outline Mip Level", Range(0,3)) = 0
  19. }
  20. SubShader {
  21. Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" }
  22. LOD 100
  23. Stencil {
  24. Ref[_StencilRef]
  25. Comp[_StencilComp]
  26. Pass Keep
  27. }
  28. UsePass "Spine/Outline/Skeleton/OUTLINE"
  29. UsePass "Spine/Skeleton Lit ZWrite/NORMAL"
  30. UsePass "Spine/Skeleton Lit ZWrite/CASTER"
  31. }
  32. FallBack "Spine/Skeleton Lit ZWrite"
  33. CustomEditor "SpineShaderWithOutlineGUI"
  34. }