views:

375

answers:

1

Hi!

I've got problems with XNA and antialiasing. I can activate it using

        graphics.PreferMultiSampling = true;
        graphics.ApplyChanges();

however - it's only 2x antialiasing. Even if I set

graphics.GraphicsDevice.PresentationParameters.MultiSampleType = MultiSampleType.SixteenSamples;

it stays only 2x antialiasing. If i go to my graphics driver settings (NVIDIA GeForce 9800 GT) and set Antialiastype from Application decides to 16x, then I get nice and clean antialiasing. But if it's set on 'Application decides' i don't get more than 2x

Anyone an idea why? Thanks!

+1  A: 

I would try following these instructions on MSDN. In this thread at the XNA forums, Shawn Hargreaves tells another person (who is using code similar to yours) that this isn't the way to setup multisampling. He indicates that it's supposed to be specified in the parameters when you create the device. The MSDN article shows which event to handle to set up antialiasing at the proper time. This thread also basically indicates the same thing: that you should perform this type of setup in the event handler.

Also, I believe the MSDN example checks for 4XAA and 2XAA, so you may have to change the code to support 16XAA. While looking into this though, I saw this quote in the first XNA thread I linked:

Also, I know of no GPU that supports 16 sub-samples for multisampling. For example the mode names "16x" that you see on Nvidia's 8000 and 9000 series actually uses 4 samples, with a quality level of "2" IIRC. The most those GPU's support is 8 sub-samples, which corresponds to the "8xQ" and "16xQ" settings.

So, I don't know exactly what settings you'll have to use to get 16XAA; you may have to play around with it a bit.

Venesectrix