BasicEffect.DiffuseColor is not capped this intentional? Is it safe to use?

I wrote some code which uses a BasicEffect with a DiffuseColor. I’m comparing the behavior between Microsoft XNA 4.0 and MonoGame DesktopGL.

I have code similar to:

effect.DiffuseColor = new Vector3(5, 5, 5);
spriteBatch.Draw(GlobalContent.Season_collection, new Vector2(0, 0), new Rectangle(0,0,100,100), Color.White);

effect.DiffuseColor = new Vector3(25, 25, 25);
spriteBatch.Draw(GlobalContent.Season_collection, new Vector2(200, 0), new Rectangle(0, 0, 100, 100), Color.White);

effect.DiffuseColor = new Vector3(.1f, .1f, .1f);
spriteBatch.Draw(GlobalContent.Season_collection, new Vector2(400, 0), new Rectangle(0, 0, 100, 100), Color.White);

I’m using a diffuse color of 5, 25, and 0.1 respectively.

In XNA the first two sprites are drawn with capped diffuse colors of 1, meaning they draw at normal color as specified by the texture. The third does in fact draw at 10% brightness, as shown in the following image:

However, in MonoGame (DesktopGL) the colors are multiplied by 5 and 25, so the first two images are far brighter, as shown in the following image:

Normally I’d say “This is wrong because it doesn’t match XNA 4 behavior” but I actually like MonoGame’s behavior more because it lets me “brighten” a sprite by setting a diffuse value greater than 1; however, I am concerned about using this in case it is “fixed” later.


  1. Is this behavior intentional or accidental?
  2. Does anyone know if this is consistent on other platforms like iOS and Android?
  3. Is this behavior I can/should depend on, or will it change in future versions to make it match XNA 4.0?

Thanks in advance for any answers.

I also rely on that behaviour. In case of fix in MG’s side I plan to make a copy of the BasicEffect code (.cs, .fx) with the current behaviour to keep compatibility.

I remember in the XNA forums people asking Shawn for this behaviour (not clamping) as in WP7 you couldn’t write your own shaders and you had better functionality without clamping the diffuse color, but this was never fixed.

I also think it’s better this way, but I can’t answer any of your questions.