title: AlphaMask in monogame not working properly
body: <p>Im trying to build a rendertarget alpha mask for a fog of war example.. I tell it that I want to clear the rendertarget with solid white (Alpha 255)</p>
  
  <p>Then I draw my image with a transparent circle, onto the alpha channel, from there I would expect to have an image in the rendertarget, with holes in it. This however is not the case.. I'm very familiar with alpha masking and have done so successfully when drawing a single image to the alpha mask, but when drawing a bunch like we have here, it fails entirely to give me proper alpha values. </p>
  
  <pre><code>if (mFogOfWarRT == null)
  {
      mFogOfWarRT = new RenderTarget2D(pGraphics.GraphicsDevice, MapSize, MapSize);
      pGraphics.GraphicsDevice.SetRenderTarget(mFogOfWarRT);
      //pGraphicsDevice.Clear(Color.Black);
  }
  else
  {
      pGraphics.GraphicsDevice.SetRenderTarget(mFogOfWarRT);
  }
  
  pGraphicsDevice.Clear(Color.White);
  pSpriteBatch.Begin();
  BlendState lKeep = new BlendState();
  lKeep.AlphaSourceBlend = Blend.One;
  lKeep.AlphaDestinationBlend = Blend.Zero;
  lKeep.ColorSourceBlend = Blend.Zero;
  lKeep.ColorDestinationBlend = Blend.One;
  lKeep.ColorBlendFunction = BlendFunction.Subtract;
  lKeep.AlphaBlendFunction = BlendFunction.Add;
  pGraphicsDevice.BlendState = lKeep;
  pGraphicsDevice.BlendState.ColorWriteChannels = ColorWriteChannels.Alpha;
  
  foreach (ClearArea lArea in mDrawQueue)
  {
      pSpriteBatch.Draw(mAlphaMask, new Rectangle((int)lArea.X, lArea.Y, lArea.Diameter, lArea.Diameter), Color.White);
  }
  //pSpriteBatch.Draw(mDot, new Rectangle(0, 0, 100, 100), Color.White);
  pSpriteBatch.End();
  
  pGraphicsDevice.SetRenderTarget(null);
  </code></pre>
  
  <p>This is my drawing code for the alpha mask.. when draws to the screen we get a white square, nothing else. </p>
  
  <p>down below I draw my "Map" to the RGB, then set the A, and draw my alphamask texture and it fails miserably </p>
  
  <pre><code>pGraphicsDevice.SetRenderTarget(null);
  
  // Draw minimap texture
  pGraphicsDevice.Clear(Color.CornflowerBlue);
  pGraphicsDevice.BlendState = lKeep;
  pGraphicsDevice.BlendState.ColorWriteChannels = ColorWriteChannels.Red | ColorWriteChannels.Blue | ColorWriteChannels.Green;
  
  pSpriteBatch.Begin();
  pSpriteBatch.Draw(mDot, new Rectangle(0, 0, 400, 400), Color.Blue);
  pGraphicsDevice.BlendState.ColorWriteChannels = ColorWriteChannels.Alpha;
  pSpriteBatch.Draw(mFogOfWarRT, Vector2.Zero, Color.White);
  
  pSpriteBatch.End();
  </code></pre>
  
  <p>Any help with this would be much appreciate.. </p>
  
  <p>paste bin of full code</p>
  
  <p><a href="http://pastebin.com/KsEVaW0d" rel="nofollow">http://pastebin.com/KsEVaW0d</a></p>
  
  <p>screen shot of outcome available if needed. </p>