IgnoreDepthMask.shader 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. Shader "Imagine/IgnoreDepthMask"
  2. {
  3. Properties
  4. {
  5. _MainTex ("Texture", 2D) = "white" {}
  6. }
  7. SubShader
  8. {
  9. // Tags { "RenderType"="Opaque" }
  10. Tags { "Queue" = "Geometry-1" }
  11. LOD 100
  12. Pass
  13. {
  14. ZWrite Off
  15. ZTest Always
  16. Cull Off
  17. CGPROGRAM
  18. #pragma vertex vert
  19. #pragma fragment frag
  20. // make fog work
  21. #pragma multi_compile_fog
  22. #include "UnityCG.cginc"
  23. struct appdata
  24. {
  25. float4 vertex : POSITION;
  26. float2 uv : TEXCOORD0;
  27. };
  28. struct v2f
  29. {
  30. float2 uv : TEXCOORD0;
  31. UNITY_FOG_COORDS(1)
  32. float4 vertex : SV_POSITION;
  33. };
  34. sampler2D _MainTex;
  35. float4 _MainTex_ST;
  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. // sample the texture
  47. fixed4 col = tex2D(_MainTex, i.uv);
  48. // apply fog
  49. UNITY_APPLY_FOG(i.fogCoord, col);
  50. return col;
  51. }
  52. ENDCG
  53. }
  54. }
  55. }