SoftMaskETC1.shader 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. Shader "Hidden/UI Default ETC1 (Soft Masked)"
  2. {
  3. // ETC1-version (with alpha split texture) of SoftMask.shader.
  4. // In Unity 5.3 this shader is the same as SoftMask.shader and it's never used.
  5. Properties
  6. {
  7. [PerRendererData] _MainTex("Sprite Texture", 2D) = "white" {}
  8. [PerRendererData] _AlphaTex("Sprite Alpha Texture", 2D) = "white" {}
  9. _Color("Tint", Color) = (1,1,1,1)
  10. [PerRendererData] _SoftMask("Mask", 2D) = "white" {}
  11. _StencilComp("Stencil Comparison", Float) = 8
  12. _Stencil("Stencil ID", Float) = 0
  13. _StencilOp("Stencil Operation", Float) = 0
  14. _StencilWriteMask("Stencil Write Mask", Float) = 255
  15. _StencilReadMask("Stencil Read Mask", Float) = 255
  16. _ColorMask("Color Mask", Float) = 15
  17. [Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip("Use Alpha Clip", Float) = 0
  18. }
  19. SubShader
  20. {
  21. Tags
  22. {
  23. "Queue" = "Transparent"
  24. "IgnoreProjector" = "True"
  25. "RenderType" = "Transparent"
  26. "PreviewType" = "Plane"
  27. "CanUseSpriteAtlas" = "True"
  28. }
  29. Stencil
  30. {
  31. Ref[_Stencil]
  32. Comp[_StencilComp]
  33. Pass[_StencilOp]
  34. ReadMask[_StencilReadMask]
  35. WriteMask[_StencilWriteMask]
  36. }
  37. Cull Off
  38. Lighting Off
  39. ZWrite Off
  40. ZTest[unity_GUIZTestMode]
  41. Blend SrcAlpha OneMinusSrcAlpha
  42. ColorMask[_ColorMask]
  43. Pass
  44. {
  45. Name "Default"
  46. CGPROGRAM
  47. #pragma vertex vert
  48. #pragma fragment frag
  49. #pragma target 2.0
  50. #if UNITY_VERSION >= 201720
  51. #pragma multi_compile __ UNITY_UI_CLIP_RECT
  52. #endif
  53. #pragma multi_compile __ UNITY_UI_ALPHACLIP
  54. #pragma multi_compile __ SOFTMASK_SIMPLE SOFTMASK_SLICED SOFTMASK_TILED
  55. #if UNITY_VERSION >= 540
  56. # define SOFTMASK_ETC1
  57. #endif
  58. #include "SoftMaskTemplate.cginc"
  59. ENDCG
  60. }
  61. }
  62. }
  63. // UNITY_SHADER_NO_UPGRADE