Unlit_Transparent.shader 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. //======= Copyright (c) Stereolabs Corporation, All rights reserved. ===============
  2. //Displays the navMesh above the current depth
  3. Shader "Custom/Unlit Transparent"
  4. {
  5. Properties
  6. {
  7. _Color("color", Color) = (1.0, 1.0, 1.0, 1.0)
  8. _Offset("Offset", Range(-200,-20)) = -20
  9. }
  10. SubShader
  11. {
  12. Tags { "RenderType"="Transparent" "Queue"="Transparent" "IgnoreProjector" = "True" }
  13. Blend SrcAlpha OneMinusSrcAlpha
  14. ZWrite Off
  15. Offset [_Offset],-2
  16. Pass
  17. {
  18. CGPROGRAM
  19. #pragma vertex vert
  20. #pragma fragment frag
  21. #include "UnityCG.cginc"
  22. struct appdata
  23. {
  24. float4 vertex : POSITION;
  25. float2 uv : TEXCOORD0;
  26. };
  27. struct v2f
  28. {
  29. float2 uv : TEXCOORD0;
  30. UNITY_FOG_COORDS(1)
  31. float4 vertex : SV_POSITION;
  32. };
  33. sampler2D _MainTex;
  34. float4 _MainTex_ST;
  35. float4 _Color;
  36. v2f vert (appdata v)
  37. {
  38. v2f o;
  39. o.vertex = UnityObjectToClipPos(v.vertex);
  40. o.uv = TRANSFORM_TEX(v.uv, _MainTex);
  41. UNITY_TRANSFER_FOG(o,o.vertex);
  42. return o;
  43. }
  44. fixed4 frag (v2f i) : SV_Target
  45. {
  46. return _Color;
  47. }
  48. ENDCG
  49. }
  50. }
  51. }