1
votes

I am currently drawing single colored pixels to my texture in XNA. However, there seems to be blending occuring, as the color I draw on the screen gets blended with my background color. How can I turn this off so that the color I draw is only the color I draw?

this.spriteBatch.Draw(texture, new Rectangle(x, y, 1, 1), [My Color]);
3

3 Answers

2
votes

Check the alpha channel of "[My Color]".

Alternatively:

device.RenderState.AlphaBlendEnable = false;
0
votes

Pass a SpriteBlendMode enumeration into your SpriteBatch.Begin call to turn off alpha blending:

spriteBatch.Begin(SpriteBlendMode.None);
0
votes

I tried the methods above without any luck. Instead I created a 1x1 solid white pixel and used that as a base to color on. It solved the blending problem.