Spine-Skeleton-OutlineOnly-URP.shader 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. Shader "Universal Render Pipeline/Spine/Outline/Skeleton-OutlineOnly" {
  2. Properties {
  3. [NoScaleOffset] _MainTex("Main Texture", 2D) = "black" {}
  4. [HideInInspector] _StencilRef("Stencil Reference", Float) = 1.0
  5. [Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp("Stencil Comparison", Float) = 8 // Set to Always as default
  6. // Outline properties are drawn via custom editor.
  7. [HideInInspector] _OutlineWidth("Outline Width", Range(0,8)) = 3.0
  8. [HideInInspector] _OutlineColor("Outline Color", Color) = (1,1,0,1)
  9. [HideInInspector] _OutlineReferenceTexWidth("Reference Texture Width", Int) = 1024
  10. [HideInInspector] _ThresholdEnd("Outline Threshold", Range(0,1)) = 0.25
  11. [HideInInspector] _OutlineSmoothness("Outline Smoothness", Range(0,1)) = 1.0
  12. [HideInInspector][MaterialToggle(_USE8NEIGHBOURHOOD_ON)] _Use8Neighbourhood("Sample 8 Neighbours", Float) = 1
  13. [HideInInspector] _OutlineMipLevel("Outline Mip Level", Range(0,3)) = 0
  14. }
  15. SubShader {
  16. // Universal Pipeline tag is required. If Universal render pipeline is not set in the graphics settings
  17. // this Subshader will fail.
  18. Tags { "RenderPipeline" = "UniversalPipeline" "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" }
  19. LOD 100
  20. Cull Off
  21. ZWrite Off
  22. Blend One OneMinusSrcAlpha
  23. Stencil {
  24. Ref[_StencilRef]
  25. Comp[_StencilComp]
  26. Pass Keep
  27. }
  28. Pass {
  29. Name "Outline"
  30. HLSLPROGRAM
  31. // Required to compile gles 2.0 with standard srp library
  32. #pragma prefer_hlslcc gles
  33. #pragma exclude_renderers d3d11_9x
  34. //--------------------------------------
  35. // GPU Instancing
  36. #pragma multi_compile_instancing
  37. #pragma vertex vertOutline
  38. #pragma fragment fragOutline
  39. #pragma shader_feature _ _USE8NEIGHBOURHOOD_ON
  40. #define USE_URP
  41. #define fixed4 half4
  42. #define fixed3 half3
  43. #define fixed half
  44. #include "../Include/Spine-Input-Outline-URP.hlsl"
  45. #include "../Include/Spine-Outline-Pass-URP.hlsl"
  46. ENDHLSL
  47. }
  48. }
  49. FallBack "Hidden/InternalErrorShader"
  50. CustomEditor "SpineShaderWithOutlineGUI"
  51. }