Global Game Jam 2022
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1.1 KiB

  1. Shader "Hidden/AlphaMask"
  2. {
  3. Properties
  4. {
  5. _MainTex ("Texture", 2D) = "white" {}
  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. fixed4 frag (v2f i) : SV_Target
  36. {
  37. fixed4 col = tex2D(_MainTex, i.uv);
  38. col.rgb = col.aaa;
  39. col.a = 1;
  40. return col;
  41. }
  42. ENDCG
  43. }
  44. }
  45. }