SpriteOverlayUnlit.shader 1.1 KB

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