InvertChannels.shader 794 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. Shader "Hidden/TriLib/InvertChannels"
  2. {
  3. Properties
  4. {
  5. _MainTex("_MainTex", 2D) = "black" {}
  6. }
  7. SubShader
  8. {
  9. // No culling or depth
  10. Cull Off ZWrite Off ZTest Always
  11. Pass
  12. {
  13. CGPROGRAM
  14. #pragma vertex vert
  15. #pragma fragment frag
  16. #include "UnityCG.cginc"
  17. struct appdata
  18. {
  19. float4 vertex : POSITION;
  20. float2 uv : TEXCOORD0;
  21. };
  22. struct v2f
  23. {
  24. float2 uv : TEXCOORD0;
  25. float4 vertex : SV_POSITION;
  26. };
  27. v2f vert(appdata v)
  28. {
  29. v2f o;
  30. o.vertex = UnityObjectToClipPos(v.vertex);
  31. o.uv = v.uv;
  32. return o;
  33. }
  34. sampler2D _MainTex;
  35. float4 frag(v2f i) : SV_Target
  36. {
  37. float4 col = tex2D(_MainTex, i.uv);
  38. return float4(1.0 * col.xyz, col.w);
  39. }
  40. ENDCG
  41. }
  42. }
  43. }