I am using AlphaTestEffect in my Spritebatch.Begin method in order to layer the depth of my character sprite with various textures in the map. However, now I am now faced with the problem of adding an alpha value to my character sprite, but am unable to do so because the AlphaTestEffect renders the sprite texture to have an opacity of either 0 or 1, but never in-between. Perhaps I am using alpha blending inappropriately, but any help would be appreciated. Below is the essentials of my drawing methods:
_alphaEffect = new AlphaTestEffect(Game.GraphicsDevice) { VertexColorEnabled = true };
_spriteBatch.Begin(SpriteSortMode.BackToFront, BlendState.NonPremultiplied, SamplerState.PointClamp, DepthStencilState.Default, RasterizerState.CullNone, _alphaEffect, viewMatrix);
//Draw the sprite with an alpha of .5--However, this does not work because I am using AlphaTestEffect!!!
Color spriteColor = animation.Sprite.Color * 0.5f;
_spriteBatch.Draw(texureRegion.Texture, animation.Sprite.WorldPosition, texureRegion.Bounds, spriteColor, 0, animation.Sprite.Origin, animation.Sprite.WorldScale, animation.Sprite.Effect, depth);
_spriteBatch.End();
_map.Draw(ref viewMatrix, ref projectionMatrix);