I have such Execution:

graphics.GraphicsDevice.Clear(new Color(255, 0, 0, 0));

Alpha is 0. So why it draws me Red color?

graphics.GraphicsDevice.Clear(new Color(255, 0, 0, 255));

Also draws the same red color. Changing alpha value doesn't affects the color on the screen. Why?

  • \$\begingroup\$ I've reverted your edit - if you have a new question please create a new question :) \$\endgroup\$ Commented Apr 10, 2013 at 5:58

1 Answer 1


The alpha value in the backbuffer does not affect what is scanned out to the screen.

However it does affect blending. For example, non-premultiplied alpha blending is:

output = source * sourceAlpha + destination * (1-sourceAlpha)

While the above uses the source alpha only (giving you the "transparency" effect you expect), you can also set up the blending stage to use the destination alpha. Most sane blend modes only use the source alpha - but using the destination alpha lets you do some fun special effects (example).

In XNA you can change the blend function by creating an instance of BlendState (MSDN).

The other reason to have an alpha value for the destination buffer is if it is a render target. When you go to use that render target as a texture, the alpha values stored in its buffer will behave as you would expect for a texture.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .