Antialiasing (AA) has been a hot topic in PC gaming over the last decade or so, as gamers look to get their games looking sharper and sharper. What started off as simple, yet demanding, brute force super sampling has transformed into a whole host of antialiasing types.
Aliasing is essentially the jaggies you experience when playing a game, uneven edges and contrasts, visual artifacts that look like the steps on a stair. Aliasing is the product of transforming a perfect quality image into one that can appeared on a pixel matrix, such as your monitor...
Any picture, be it in a magazine, on a screen or from a camera, is made up of tiny little dots laid out in a grid format. Get out a magnifying glass on any image and sure enough if you zoom in far enough the dots/pixels become apparent. This is the essence of screen resolution, a monitor outputting at 1600 x 1200 resolution will have a grid measuring 1600 pixels up and 1200 pixels across, for a total output of 1.92 million pixels. The larger the monitor the higher the resolution needed to maintain the quality of the image, without looking at it from further back of course.
If you were to lower the resolution on a larger monitor the dots making up the image would have to be stretched out across the screen to cover the full area, giving a more pixellated image. Drawing a straight diagonal line across a low resolution image you can clearly see the individual pixels; this is the effect known as aliasing. As you raise the resolution you increase the number of dots needed to display the line, the diagonal line will look sharper and more defined.
Of course, it’s not as simple as just whacking up the resolution to cancel out any form of aliasing; the higher the resolution the greater the number of pixels needed to be pumped out by the GPU, slowing down performance as it outputs the potentially millions of pixels per frame. As well as this, the higher the resolution, the smaller an object appears. Jamming a PC up to ridiculous resolutions will often shrink aspects of your display so much you can barely make them out.
Antialiasing is, in a nutshell, making the images your GPU is throwing out look better without increasing the resolution, by blending sharp edges using colour and reducing the appearance of jagged lines. The blending can create a blurred effect if overdone, with the advanced AA techniques aiming to reduce aliasing while keeping blurring to an absolute minimum.
On curved or slanted lines without AA the dot matrix on a monitor can give a visual inconsistency on the edges of objects, as the GPU powering the image will only colour a pixel if the line passing through it occupies more than half the space, resulting in a jagged edge where our vision would normally expect a smooth line.
To overcome this and to smooth the edges of objects a process called sampling is used. As a concept it’s easiest to visualise the diagonal lines above. Each pixel on the line is blended with the pixel next to it, and rather than use one central point to dictate the colour of a pixel it is divided into sub-pixels. The average colour of each of these sub-pixels is calculated and applied, creating a progressive blend from pixel to pixel.
Without anti-aliasing (AA) there is only a single point in the centre of the pixel that dictates the colour, with AA though there are a infinitesimal number of points .
There are essentially two basic ways in which to achieve the effects of Anti-Aliasing:
1. Increasing the sample rate.
2. Blurring the edges, also known as Post-Processing or Post-AA.
Here's a run down of some of the AA options you can expect to see in many of today's games; how they work and the sort of performance impact they will have on a system.
The easiest methods to increase the sample rate are Full Screen AA (FSAA) and Super Sampling AA (SSAA). This is often regarded as an old-fashioned method of antialiasing due to the huge performance hit it can take on systems, but it produces excellent results.
In both of these cases there are an increased amount of samples used, and the colour of each pixel is calculated using the the values of the samples inside it. Effectively the image is upscaled to say, quadruple its size, and each pixel of the now increased image has its colour altered dependent upon the four pixels surrounding it. Then it’s downsized back to its original resolution and output as a smoother image. Doubling the image would be 2xAA, quadrupling would be 4xAA etc.
This form of anti-aliasing causes much sharper textures while reducing aliasing due to the higher sample rate. Unfortunately, as stated before, it takes a huge power hit on a system as it’s a brute-force method, effectively rendering the same image equal to the resolution times the sampling rate before reconstructing it. This is one for the top-end enthusiasts and of course those using SLI and Crossfire configurations.
MSAA, or multi-sampling anti-aliasing, was introduced with the advent of DirectX 8, and significantly reduces the performance hit in comparison to techniques such as SSAA. MSAA still oversamples the entire frame, but detects the edges of polygonal objects and only increases the number of samples at those points. This is a method that significantly lowers the performance requirement in comparison to supersampling, providing more acceptable frame rates that make it popular in 3D games.
MSAA can be forced at several sampling rates from 2x right up to 16x, obviously for a greater performance hit. Unfortunately it doesn’t prevent the aliasing of alpha textures, that is to say that translucent objects won’t receive the benefits of anti-aliasing.
Morphological AA and Fast Approximate AA are post-processing AA shaders developed by AMD and Nvidia respectively that have been designed to be a faster alternative to 4X MSAA.
They detect the contrasts in a frame and then blur along the gradient, significantly reducing visible jaggies, including alpha textures. Unfortunately it doesn’t end there, blurring everything to some degree in a frame, but due to its high-performance they are often the go-to AA in console versions of games.
Enhanced Subpixel Morphological anti-aliasing (SMAA for those who don’t like their tongues twisted) is a post-processing technique based on MLAA and FXAA but using the detection process seen in MSAA. This is a relatively undemanding form of AA that works to great effect in combination with MSAA or FSAA, detecting the edges of objects and smoothing them rather than the AA en masse that leads to a blurred effect seen in MLAA and FXAA. Combining both MSAA/FSAA and SMAA should give you some of the best results possible if your rig is up to it.
The above image demonstrates SMAA use, with the top line representing a zoomed out image and the bottom image what it looks like close up.
On modern graphics cards antialiasing can now be achieved at a reasonable performance cost across the board, but to hit those higher settings and sampling rates is going to come at a larger performance loss. Newer cards have significantly more VRAM onboard which is a primary helper in this situation, although the performance you can expect is going to vary significantly from game to game.