I need SpriteBatch
to render images how I would expect in WPF or a normal UIKit app:
- partially transparent PNGs render on top of one another, as you would expect
- I have an alpha I can modify, preferably something like using
Color.White
and modifying theA
value.
Closest has been using BlendState.NonPremultiplied
, but I get weird lines where partially transparent PNGs overlap on one another.
I was having similar issues on Windows (see here), but fixed it by changing the Premultiplied
setting in the XNA content project. How can I do similar for MonoGame? (I'm expecting there is a difference in OpenGL here)
We solved it by using two different setups.
On Windows and XNA:
BlendState.NonPremultiplied
Color.White
and setA
valueOn MonoGame and iOS:
BlendState.AlphaBlend
Color.White * (float)Alpha / (float)byte.MaxValue
My PNGs are not pre-multiplied and are used exactly as you'd expect coming out of Photoshop.