Porting a game using MonoGame on OS X: color issue

I have my game project working in MonoDevelop using MonoGame on OS X, but the colors in the game are very confusing. For example, yellow is displayed as blue. What could be the reason for this? My game is ported from XNA. Android and iOS ports do not have this problem.

Wrong colors are all colors. The colors to be displayed are instead displayed as some other colors. For example, yellow is displayed as blue, blue is displayed as orange, etc. Graphics are displayed otherwise.

I just use SpriteBatch directly to the buffer and do not run any effects or post-processing on it. My code for Begin() is this:

 spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.NonPremultiplied, SamplerState.LinearClamp, DepthStencilState.Default, RasterizerState.CullNone, null, SpriteScale); 

When I draw a texture, I draw it like this:

 spriteBatch.Draw(texture, new Vector2(0f, 0f), Color.White); 

Screen capture

I tried replacing all .png files with my .xnb counterparts, and the game is still ongoing, but I still get the same wrong colors.

I became aware that BlendState.NonPremultiplied should not be right, but when I do not have it, I get these very bad outlines and white blocks around images that should not be there.

+4
source share

Source: https://habr.com/ru/post/1446326/


All Articles