Hi,
I'm having some problems getting postprocessing and multisampling to work together :(
I'm using the BloomPostProcess sample as a base but when I turn on multisampling I get this exception:
InvalidOperationException
The active render target and depth stencil surface must have the same pixel size and multisampling type.
In 2.0 beta I solved this by changing the initialisation of the rendertargets (BloomComponent.LoadContent) to take the backbuffer multisample settings into account:
renderTarget1 = new RenderTarget2D(GraphicsDevice, width, height, 1,
format, pp.MultiSampleType, pp.MultiSampleQuality);
renderTarget2 = new RenderTarget2D(GraphicsDevice, width, height, 1,
format, pp.MultiSampleType, pp.MultiSampleQuality);
However in 2.0 final I still get the exception :( In 1.0 everything just worked.
I turn multisampling on by adding the following to Game.cs:
protected override void Initialize()
{
MultiSampleType multiSampleType = MultiSampleType.FourSamples;
GraphicsDevice.PresentationParameters.MultiSampleType = multiSampleType;
int qualityLevels;
GraphicsAdapter.DefaultAdapter.CheckDeviceMultiSampleType(DeviceType.Hardware,
graphics.GraphicsDevice.DisplayMode.Format,
false, multiSampleType, out qualityLevels);
GraphicsDevice.PresentationParameters.MultiSampleQuality = qualityLevels - 1;
graphics.ApplyChanges();
base.Initialize();
}
Any ideas? Should think that multisampling and postprocessing should be possible at the same time.
-Pelle