MiniMapOverlayClampedUnlit.shader 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. Shader "CompassNavigatorPro/MiniMap Overlay Unlit Clamped"
  2. {
  3. Properties
  4. {
  5. _Color ("Main Color", Color) = (1,1,1,1)
  6. _MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
  7. _StencilComp ("Stencil Comparison", Float) = 8
  8. _Stencil ("Stencil ID", Float) = 0
  9. _StencilOp ("Stencil Operation", Float) = 0
  10. _StencilWriteMask ("Stencil Write Mask", Float) = 255
  11. _StencilReadMask ("Stencil Read Mask", Float) = 255
  12. _ColorMask ("Color Mask", Float) = 15
  13. }
  14. SubShader
  15. {
  16. Tags
  17. {
  18. "Queue"="Transparent+100"
  19. "IgnoreProjector"="True"
  20. "RenderType"="Transparent"
  21. "DisableBatching"="LODFading"
  22. }
  23. Cull Off
  24. ZWrite Off
  25. ZTest Always
  26. Blend SrcAlpha OneMinusSrcAlpha
  27. Pass
  28. {
  29. CGPROGRAM
  30. #pragma vertex vert
  31. #pragma fragment frag
  32. #include "UnityCG.cginc"
  33. struct appdata
  34. {
  35. float4 vertex : POSITION;
  36. float2 uv : TEXCOORD0;
  37. half4 color : COLOR;
  38. };
  39. struct v2f
  40. {
  41. float4 vertex : SV_POSITION;
  42. float2 uv : TEXCOORD0;
  43. half4 color : COLOR;
  44. };
  45. sampler2D _MainTex;
  46. float4 _MainTex_ST;
  47. fixed4 _Color;
  48. v2f vert (appdata v)
  49. {
  50. v2f o;
  51. o.vertex = UnityObjectToClipPos(v.vertex);
  52. o.uv = TRANSFORM_TEX(v.uv, _MainTex);
  53. o.color = v.color;
  54. return o;
  55. }
  56. fixed4 frag (v2f i) : SV_Target
  57. {
  58. half4 col = tex2D(_MainTex, i.uv) * i.color;
  59. col *= _Color;
  60. return col;
  61. }
  62. ENDCG
  63. }
  64. }
  65. FallBack Off
  66. }