4

I have my game project running in MonoDevelop using MonoGame on OS X, but the colors in the game are very mixed up. For example, yellow is shown as blue. What could be causing this? My game is ported from XNA. The android and iOS ports don't have this color problem.

The wrong colors are all the colors. The colors that are supposed to be showing are instead showing as some other colors. For example, yellow is shown as blue, blue is shown as orange, etc.. The graphics are being shown correctly otherwise.

I'm just using SpriteBatch straight to the buffer and not running any effects or post-processing on it. My code for the 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 for example:

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

Screen capture

I tried replacing all of the .png files with their .xnb counterparts and the game runs still, but I still get the same wrong colors.

I've been made aware that BlendState.NonPremultiplied shouldn't be right, but when I don't have it set to that, then I get these really bad outlines and white blocks around the images that aren't supposed to be there.

pinckerman
  • 4,115
  • 6
  • 33
  • 42
  • 1
    Sounds like a RGB vs BGR issue (red and blue channels getting swapped). It would not surprise me if this were a bug in MonoGame. Also: `BlendState.Alpha` is preferred - but it requires your content to be premultiplied (this is done by default by the XNA content pipeline). – Andrew Russell Nov 16 '12 at 02:04
  • Hi David are you using the xnbs in your MacOS project or native bitmaps ( png, jpeg etc )? – Dominique Dec 04 '12 at 22:55
  • 1
    Make sure you are building against the most recent version of monogame's develop branch, or have them merged into your fork. I know of several fixes in this area that have occured in the last months. – James Jan 10 '15 at 04:05

1 Answers1

0

This question was asked before RGB-> BGR correction or just after, either way it has been resolved.