Antialiasing Algorithms

References :

SSAA – we get an excellent picture but a noticeable load on the video card. MSAA – rarely used, suitable for games with large objects in the graphics. FXAA – the edges of objects are indeed smoothed, but so much so that the entire image is blurred. MLAA – the algorithm loads the processor without affecting the comfort in the game, but the picture is blurry. SMAA – the game’s performance drops a lot, and the picture becomes fuzzy. TXAA – an excellent option for games where most frames are static. DSR – the technology is rarely used and puts a large load on the video card. CSAA / CFAA – we get a picture of excellent quality, including small objects.

Algorithms :

  • SSAA: supersample anti-aliasing that temporarily uses a much higher resolution render buffer to render the scene in (super sampling).
  • MSAA: multisample anti-aliasing samples multiple locations within every pixel and combines these samples to produce the final pixel.
    • Solves spatial aliasing issues.
    • Much more resource intensive.
  • FXAA: Fast Approximate Anti-Aliasing. Smooths edges on a per-pixel level.
    • Drawback : sharp, high contrast noise in textures gets blurred a bit.
    • An implementation edge smoothing.
  • NFAA: Normal Filtered Anti-Aliasing.
    • In best cases it resembles 16x MSAA and in worst cases it’s like 2x MSAA.
  • SMAA: Subpixel morphological anti-aliasing developed from morphological anti-aliasing.finds patterns in the borders of an image and blends the pixels on these borders according to the pattern it finds.
    • Has much sharper results than FXAA and is well suited for flat, cartoon-like, or clean art styles.
  • TAA : Temporal anti-aliasing uses frames from a history buffer to smooth edges more effectively than FXAA.
    • Drawback: it often creates ghosting artifacts in extreme situations.
    • Step-by-step
  • Phone-wire AA.

Mipmap

Mipmap or pyramids are pre-calculated, optimized sequences of images, each of which is a progressively lower resolution representation of the previous.

  • enable : glGenerateMipmap(GL_TEXTURE_2D);
  • set properly GL_TEXTURE_MAX_LEVEL: the highest defined mipmap level.

Anisotropic

When viewing a texture from a distance, texture coordinates change, especially at oblique angles. The different sampling points can cause the colors of distant pixels to change continuously. OpenGL anisotropic

GLfloat max_anisotropy = 8.0f;
glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &max_anisotropy);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT,
                (kAntiSotropyValue > max_anisotropy) ? max_anisotropy : kAntiSotropyValue);