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

Problems with Anti-Aliasing

Last post 05-16-2008 11:06 AM by Shawn Hargreaves. 3 replies.
  • 05-16-2008 6:36 AM

    Problems with Anti-Aliasing

    Hello, Im trying to do a simple astroids game but I got some problems with the anti aliasing, as you can see on the screenshot below. It doesnt show clear on the picture below but it surely isnt anti-aliased

    http://img59.imageshack.us/my.php?image=screengb9.png

    I make random "comets" in GDI+ on bitmaps and loads them in textures as streams and then renders them with Spritebatch.

    The initializing code:

    graphics.PreferMultiSampling = true;
    graphics.ApplyChanges();
    Isnt it possible to have anti-aliasing on 2D or am I doing something horribly wrong?
  • 05-16-2008 8:14 AM In reply to

    Re: Problems with Anti-Aliasing

    You're saying that that red line is a bitmap / texture?

    If so: there's no way that the graphics device can anti-alias the contents of a texture... it can anti-alias the edges of one, but not the "stuff" in it. Antialiasing is for smoothing out edges, edges of polygons, not what is "in" them.

    If not: How are you drawing those red lines? Also, when are you calling those two lines in listed above, in the constructor for your Game? If so, you don't need the ApplyChanges().

  • 05-16-2008 10:48 AM In reply to

    Re: Problems with Anti-Aliasing

    If you truly need to smooth the jagged edges of the red lines, you'd have to fake it with bloom postprocessing or something, which just hides jagged edges by covering them up with a slight blur. Seems a lot of developers use bloom/HDR to "cheat" that way.
    XNA QuickStart Engine | My site
    "I'll be whatever I want to do!", Philip J. Fry
  • 05-16-2008 11:06 AM In reply to

    Re: Problems with Anti-Aliasing

    In this case the easiest solution is just to tell GDI+ to antialias while it is creating your source images.
    XNA Framework Developer - blog - homepage
Page 1 of 1 (4 items) Previous Next