SpriteBlur.shader 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. Shader "UI/Sprite Blur" {
  2. Properties {
  3. _MainTex ("Main Texture", 2D) = "white" {}
  4. _Size ("Size", Range(0, 10)) = 5.0
  5. [HideInInspector]
  6. _StencilComp ("Stencil Comparison", Float) = 8
  7. [HideInInspector]
  8. _Stencil ("Stencil ID", Float) = 0
  9. [HideInInspector]
  10. _StencilOp ("Stencil Operation", Float) = 0
  11. [HideInInspector]
  12. _StencilWriteMask ("Stencil Write Mask", Float) = 255
  13. [HideInInspector]
  14. _StencilReadMask ("Stencil Read Mask", Float) = 255
  15. }
  16. Category {
  17. Tags {
  18. "Queue"="Transparent"
  19. "IgnoreProjector"="True"
  20. "RenderType"="Opaque"
  21. }
  22. Cull Off
  23. Stencil {
  24. Ref [_Stencil]
  25. Comp [_StencilComp]
  26. Pass [_StencilOp]
  27. ReadMask [_StencilReadMask]
  28. WriteMask [_StencilWriteMask]
  29. }
  30. SubShader {
  31. GrabPass {
  32. "_SpriteBlurTextureV"
  33. }
  34. // Vertical
  35. Pass {
  36. Name "VERTICAL"
  37. Tags { "LightMode" = "Always" }
  38. CGPROGRAM
  39. #pragma vertex vert
  40. #pragma fragment fragY
  41. #pragma fragmentoption ARB_precision_hint_fastest
  42. #include "UnityCG.cginc"
  43. #include "BlurCG.cginc"
  44. ENDCG
  45. }
  46. GrabPass {
  47. "_SpriteBlurTextureH"
  48. }
  49. // Horizontal
  50. Pass {
  51. Name "HORIZONTAL"
  52. Tags { "LightMode" = "Always" }
  53. CGPROGRAM
  54. #pragma vertex vert
  55. #pragma fragment fragX
  56. #pragma fragmentoption ARB_precision_hint_fastest
  57. #include "UnityCG.cginc"
  58. #include "BlurCG.cginc"
  59. ENDCG
  60. }
  61. }
  62. }
  63. }