Hi,
Rather confused here. I am drawing 2D sprites using this type of approach…
spriteBatch.Begin (SpriteSortMode.Immediate, BlendState.AlphaBlend, null, null, rasterizer_state);
…this works fine on iOS. However it appears that on Android all the semi-transparent areas on my images are being rendered as opaque (or something similar anyway). I’m using exactly the same source files for both projects which are ‘raw’ 24bit PNGs saved from Photoshop using ‘Save For Web’ and loaded with Content.Load().
I have tried using BlendState.NonPreMultipled instead and this gets Android working but when I draw sprites not at full opacity they seem to be fading to black somehow. Thinking about it this could be because I’m pre-multiplying the ‘tint’ colour rather than just setting an alpha value. I’d rather use the same BlendState for both platforms though and from what I’ve read BlendState.Aplha sounds as though it should be more efficient.
I’m guessing the issue has something to do with the PNGs not being saved with premultipled alpha. I don’t know why it’s working on iOS but, again, am guessing there’s some kind of pre-processing involved with PNGs on iOS.
Is there a definitive way of saving 24bit PNGs with premultiplied alpha on Mac OS? Whilst googling I found a link to an app that supposedly did it but it was Windows only.
Thanks in advance for any help…