GreyCameraShader.shader 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. Shader "Unlit/GreyCameraShader"
  2. {
  3. Properties
  4. {
  5. _MainTex ("Texture", 2D) = "white" {}
  6. }
  7. SubShader
  8. {
  9. Tags
  10. {
  11. "RenderType"="Background"
  12. "Queue"="Background+100"
  13. }
  14. LOD 100
  15. ZWrite off
  16. cull back
  17. Pass
  18. {
  19. CGPROGRAM
  20. #pragma vertex vert
  21. #pragma fragment frag
  22. // make fog work
  23. #pragma multi_compile_fog
  24. #include "UnityCG.cginc"
  25. struct appdata
  26. {
  27. float4 vertex : POSITION;
  28. float2 uv : TEXCOORD0;
  29. };
  30. struct v2f
  31. {
  32. float2 uv : TEXCOORD0;
  33. //UNITY_FOG_COORDS(1)
  34. float4 vertex : SV_POSITION;
  35. };
  36. sampler2D _MainTex;
  37. float4 _MainTex_ST;
  38. v2f vert (appdata v)
  39. {
  40. v2f o;
  41. o.vertex = UnityObjectToClipPos(v.vertex);
  42. o.uv = TRANSFORM_TEX(v.uv, _MainTex);
  43. o.uv.x = 1.0 - o.uv.x;
  44. //UNITY_TRANSFER_FOG(o,o.vertex);
  45. return o;
  46. }
  47. fixed4 frag (v2f i) : SV_Target
  48. {
  49. // sample the texture
  50. fixed4 col = tex2D(_MainTex, i.uv);
  51. // apply fog
  52. //UNITY_APPLY_FOG(i.fogCoord, col);
  53. return fixed4(col.a, col.a, col.a, 1);
  54. }
  55. ENDCG
  56. }
  57. }
  58. }