ShowAlphaChannel.shader 861 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. // Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
  2. Shader "Hidden/ShowAlphaChannel" {
  3. Properties {
  4. _MainTex ("Base (RGB)", 2D) = "white" {}
  5. _EdgeTex ("_EdgeTex", 2D) = "white" {}
  6. }
  7. SubShader {
  8. Pass {
  9. ZTest Always Cull Off ZWrite Off
  10. Fog { Mode off }
  11. CGPROGRAM
  12. #pragma vertex vert
  13. #pragma fragment frag
  14. #pragma fragmentoption ARB_precision_hint_fastest
  15. #include "UnityCG.cginc"
  16. uniform sampler2D _MainTex;
  17. uniform sampler2D _EdgeTex;
  18. uniform float4 _MainTex_TexelSize;
  19. float filterRadius;
  20. struct v2f {
  21. float4 pos : POSITION;
  22. float2 uv : TEXCOORD0;
  23. };
  24. v2f vert( appdata_img v )
  25. {
  26. v2f o;
  27. o.pos = UnityObjectToClipPos (v.vertex);
  28. o.uv = v.texcoord.xy;
  29. return o;
  30. }
  31. half4 frag (v2f i) : COLOR
  32. {
  33. half4 color = tex2D(_MainTex, i.uv.xy);
  34. half edges = color.a;
  35. return edges;
  36. }
  37. ENDCG
  38. }
  39. }
  40. Fallback off
  41. }