XNA Creators Club Online
Page 1 of 1 (7 items)
Sort Posts: Previous Next

Anti-alias seems does not work

Last post 31/03/2009 17:18 by Shawn Hargreaves. 6 replies.
  • 20/11/2008 15:18

    Anti-alias seems does not work

    Hi all!

    What is wrong with the code which I try to turn on the anti-alias feature? (using c# 2008 and XNA 3.0)

                graphicsDevice = new GraphicsDevice(GraphicsAdapter.DefaultAdapter, 
                                                    DeviceType.Hardware, 
                                                    windowHandle, 
                                                    parameters); 
                 
                //Antialias 
                graphicsDevice.RenderState.MultiSampleAntiAlias = true
                graphicsDevice.PresentationParameters.MultiSampleType = 
                        MultiSampleType.SixteenSamples; 
                graphicsDevice.PresentationParameters.MultiSampleQuality = 8; 
     

    Thank you in advance.
  • 20/11/2008 15:48 In reply to

    Re: Anti-alias seems does not work

    Why do you say it doesn't seem to work?
    Jim Perry - Microsoft XNA MVP
    If people spent a minute searching the forums and reading the FAQs before posting I'd be out of a job.
      Got some XNA Game Studio/XNA Framework development info to share with the community? Put it on the XNA Wiki.
        Please mark posts as Answers or Good Feedback when appropriate.
  • 20/11/2008 16:41 In reply to

    Re: Anti-alias seems does not work

    That's not how you turn on multisampling. You specify this in the parameters when you create the device. You can't (at least not easily) change it afterward.
    XNA Framework Developer - blog - homepage
  • 20/11/2008 18:29 In reply to

    Re: Anti-alias seems does not work

    Jim Perry:
    Why do you say it doesn't seem to work?


    Because the objects are not build as they could be if the antialias were turned on.
  • 20/11/2008 19:07 In reply to

    Re: Anti-alias seems does not work

    Like Shawn mentioned changing the presentation parameters after you've created the device will have no effect.  You'd have to reset the device using the new parameters for them to take effect.

    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.
    Matt Pettineo | DirectX/XNA MVP


    Ride into The Danger Zone | PIX With XNA Tutorial
  • 31/03/2009 7:21 In reply to

    Re: Anti-alias seems does not work

    And is there a way to make a postprocess with multisampling?
  • 31/03/2009 17:18 In reply to

    Re: Anti-alias seems does not work

    Scyde:
    And is there a way to make a postprocess with multisampling?


    Sure. Make a mutlisampled rendertarget, draw your scene to it, then apply the postprocess. This works the same regardless of whether you are multisampling or not, it all just depends on whether you create the rendertarget with multisampling or not.
    XNA Framework Developer - blog - homepage
Page 1 of 1 (7 items) Previous Next