Shawn you are 100% right regarding the renderstates and I feel so dumb.
In case anyone is interested here is what I did to find out whats wrong.
To narrow the problem I created a scene with one single textured quad, same problem on winforms version and transparency on game version.
As PIX refused to provide information on the winform version I started the game version to check if anything wrong is happening.
Usually I only use the single frame capture but this time I decided to record a repleyable call stream.
Inspecting the first 2 frames revealed that the quad is rendered without transparency and after the second frame with transparency...and then it hit me.
There is one more difference between the winform version and the game version - I was using a SpriteBatch to render the FPS counter in one corner.
Commented out the function and verified that the quad is rendered without the transparency :-/
PIX showed that the alphatest was on but the compare function was set to always until the spritebatch kicked in and changed it to compare greater.
Currently I decided to set a whole bunch of renderstates inside the SceneManager's Draw:
| #region renderstates |
| //---------------------------------- |
| // Set most common RenderState's |
| //---------------------------------- |
| Game.GraphicsDevice.RenderState.AlphaBlendEnable = true; |
| Game.GraphicsDevice.RenderState.AlphaBlendOperation = BlendFunction.Add; |
| Game.GraphicsDevice.RenderState.AlphaDestinationBlend = Blend.Zero; |
| Game.GraphicsDevice.RenderState.SourceBlend = Blend.SourceAlpha; |
| Game.GraphicsDevice.RenderState.AlphaTestEnable = true; |
| Game.GraphicsDevice.RenderState.AlphaSourceBlend = Blend.One; |
| Game.GraphicsDevice.RenderState.AlphaFunction = CompareFunction.Greater; |
But I wonder if that is smart since it is a per frame task?
I completely hate SpriteBatches and usually avoid them but who could resist not to use them for such trivial tasks as rendering the FPS stat?