Alpha From PNGs Butchered

Posted by ashes999 on Game Development See other posts from Game Development or by ashes999
Published on 2012-11-29T21:57:28Z Indexed on 2012/11/29 23:21 UTC
Read the original article Hit count: 267

Filed under:
|
|

I have a pretty vanilla Monogame game. I'm using PNG for all my sprites (made in Photoshop). I noticed that XNA is butchering the aliasing; no matter what I do, my graphics appear jaggedy.

Below is a screenshot. The bottom half is what XNA shows me when I zoom in 2X using a Matrix on my GraphicsDevice (to make the effect more obvious). The top is when I pasted the same sprites from Photoshop and scaled them to 200%.

Note that partially transparent pixels are turning whiteish.

Is there a way to fix this? What am I doing wrong?

Here's the relevant call to draw to the SpriteBatch:

spriteBatch.Draw(this.texture, this.positionVector, null, Color.White, this.Angle, this.originVector, 1f, SpriteEffects.None, 0f);

(this.positionVector can easily be Vector.Zero; Color.White as 100% alpha, I think; this.Angle can be a real angle (small > in the image) or zero (the orb itself).

enter image description here

© Game Development or respective owner

Related posts about XNA

Related posts about antialiasing