title: Alpha channel on my unity shader is not working
body: <p>So I am very new to shader programing (basically just started today) and I got this code from a tutorial on Youtube which works great. It just found the pixel on the edge of a texture, and if so, replace it with a plain color. I want to be able to set the transparency of the color i'm returning.</p>
  
  <p>But it does not seems to be working</p>
  
  <pre><code>Shader "Custom/OutlineShader"
  {
      Properties
      {
          _MainTex ("Texture", 2D) = "white" {}
          _Color("Color", Color) = (1, 1, 1, 1)
          _AlphaOffset("Transparency", Range(0,1)) = 1
      }
      SubShader
      {
          Tags{ "Queue"="Transparent" "RenderType"="Opaque"}
          Cull Off ZWrite Off ZTest Always
  
          Pass
          {
              CGPROGRAM
              #pragma vertex vert
              #pragma fragment frag Lambert alpha
  
              #include "UnityCG.cginc"
  
              struct appdata
              {
                  float4 vertex : POSITION;
                  float2 uv : TEXCOORD0;
              };
  
              struct v2f
              {
                  float2 uv : TEXCOORD0;
                  float4 vertex : SV_POSITION;
              };
  
  
              fixed4 _Color;
              sampler2D _MainTex;
              float4 _MainTexelSize;
              float _AlphaOffset;
  
              v2f vert (appdata v)
              {
                  v2f OUT;
                  OUT.vertex = UnityObjectToClipPos(v.vertex);
                  OUT.uv = v.uv;
  
                  return OUT;
              }
  
              fixed4 frag (v2f i) : SV_Target
              {
                  fixed4 col = tex2D(_MainTex, i.uv);
  
                  col.rgb *= col.a;
  
                  fixed4 outlineColor = _Color;
  
                  // This is where I want the shader to be transparent or not based on the _AlphaOffset Value
                  outlineColor.a *= ceil(col.a) * _AlphaOffset;
  
                  // This a code just to check is the current pixel is on the edge of the texture
                  fixed upAlpha = tex2D(_MainTex, i.uv + fixed2(0, _MainTexelSize.y)).a;
                  fixed downAlpha = tex2D(_MainTex, i.uv - fixed2(0, _MainTexelSize.y)).a;
                  fixed leftAlpha = tex2D(_MainTex, i.uv - fixed2(_MainTexelSize.x, 0)).a;
                  fixed rightAlpha = tex2D(_MainTex, i.uv + fixed2(_MainTexelSize.x, 0)).a;
  
                  // If it's on the edge, return the color (+ alpha) else, just return the same pixel
                  return lerp(outlineColor, col, ceil(upAlpha * downAlpha * leftAlpha * rightAlpha));
              }
              ENDCG
          }
      }
  }
  
  </code></pre>
  
  <p>I would like this line 
  <code>outlineColor.a *= ceil(col.a) * _AlphaOffset;</code> to set the alpha of the pixel I'm returning.</p>
  
  <p>Thanks !</p>