Sprite-Mask.shader 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. Shader "Universal Render Pipeline/2D/Sprite-Mask"
  2. {
  3. Properties
  4. {
  5. [PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {}
  6. [HideInInspector] _Cutoff ("Mask alpha cutoff", Range(0.0, 1.0)) = 0.0
  7. }
  8. HLSLINCLUDE
  9. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
  10. ENDHLSL
  11. SubShader
  12. {
  13. Tags
  14. {
  15. "Queue"="Transparent"
  16. "IgnoreProjector"="True"
  17. "RenderType"="Transparent"
  18. "PreviewType"="Plane"
  19. "CanUseSpriteAtlas"="True"
  20. "RenderPipeline" = "UniversalPipeline"
  21. }
  22. Cull Off
  23. Lighting Off
  24. ZWrite Off
  25. Blend Off
  26. ColorMask 0
  27. Pass
  28. {
  29. Tags{ "LightMode" = "Universal2D" }
  30. HLSLPROGRAM
  31. #pragma vertex MaskRenderingVertex
  32. #pragma fragment MaskRenderingFragment
  33. #include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/SpriteMaskShared.hlsl"
  34. ENDHLSL
  35. }
  36. Pass
  37. {
  38. Tags{ "LightMode" = "NormalsRendering" }
  39. HLSLPROGRAM
  40. #pragma vertex MaskRenderingVertex
  41. #pragma fragment MaskRenderingFragment
  42. #include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/SpriteMaskShared.hlsl"
  43. ENDHLSL
  44. }
  45. Pass
  46. {
  47. Tags{ "LightMode" = "UniversalForward" }
  48. HLSLPROGRAM
  49. #pragma vertex MaskRenderingVertex
  50. #pragma fragment MaskRenderingFragment
  51. #include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/SpriteMaskShared.hlsl"
  52. ENDHLSL
  53. }
  54. }
  55. }