If you click on a link and make a purchase we may receive a small commission. Read our editorial policy.

Tech Focus: The Rise of FXAA

Digital Foundry on NVIDIA's ultra-fast, high quality anti-aliasing technology

Previously on Digital Foundry we discussed how morphological anti-aliasing (MLAA) has evolved from a theory put together by Intel into a working technology for PlayStation 3, developed by Sony's Advanced Technology Group (ATG) and is now evolving into a viable solution for both Xbox 360 and PlayStation 3.

However, MLAA isn't the only solution being worked on by the industry - far from it. Over at NVIDIA, technology developer Timothy Lottes has been working on an alternative to MLAA which is winning widespread acclaim. Lottes' FXAA technique is remarkable in that in its console iteration, it is able to process a 720p framebuffer using around 1ms of GPU time. Bearing in mind that the average console 30FPS game allocates 33.33ms to each frame, this means that anti-aliasing can be implemented without a radical impact on game performance.

Just like MLAA, FXAA is a post-process, screen-space anti-aliasing filter. This means that each frame is generated as per normal, with the AA code considering the image as one flat object for analysis. MLAA seeks out edges within the image and blends them. The advantage is that the edge-smoothing itself is nothing short of exemplary, but "false-positive" readings on what are edges and what are not can result in some ugly artifacting, especially in motion. Sub-pixel detailing can also look poor, with pixel-popping artifacts exaggerated rather than diminished.

As FXAA is a post process filter, we can run the code over digitally precise HDMI captures of games with no anti-aliasing to gauge its results in motion. Enslaved benefits immensely from the technique, while Castlevania is a great work-out for processing pixel-popping. The final game is Need for Speed: Hot Pursuit, which proved to be quite a challenge for MLAA. Make sure you use the full-screen button for full 720p resolution.

In fairness, the Jimenez MLAA technique we looked at proved to be quite adept at skipping sub-pixel issues, providing a very clean look, but the approach that FXAA takes is an altogether different technique, and has been specifically developed to make the most of console and PC graphics technology.

Modern PC graphics cards are several generations ahead of the RSX and Xenos graphics cores within the consoles, meaning that FXAA comes in two distinct flavours - an ultra-fast rendition for the consoles (FXAA works on both Xbox 360 and PlayStation 3, though in some cases the 360 has a performance advantage) while the PC version, as author Timothy Lottes puts it, "is designed to take advantage of the feature and performance advantage PC GPUs have to provide very high quality."

But what is FXAA? How does it work and how is it different to the other post-process anti-aliasing technologies out there? Criterion's Alex Fry described it to us as a "heuristic blur filter", which chimes nicely with the author's own more detailed description.

"FXAA Console conditionally applies a blur filter which adapts in length and in sample locations based on a pixel's contrast and local gradient - effectively an artistically modelled intelligent blur filter," NVIDIA's Timothy Lottes says.

"FXAA Quality [for PC] re-samples the image by shifting each pixel's centre. Pixel shift is computed by a combination of an MLAA-like approach (which is limited to searching in either the vertical or horizontal direction) and an algorithm which detects possible pixel-sized or sub-pixel sized features… Visually the PC version is sharper and has higher quality on near horizontal and near vertical edges."

The new technique is intriguing in that Lottes targets FXAA to do more than just smooth edges and eliminate "jaggies". It targets anti-aliasing in a much broader sense in that it attempts to eliminate distortion effects that appear when a higher resolution image is rendered in a lower resolution. As Lottes says on his blog:

"Single-pixel sized features alias by snapping from pixel to pixel, and sub-pixel sized features alias by flickering on and off as they overlap a pixel's centre. To me, this is more visually distracting than edge crawling on multi-pixel features."

As you can see in these images, FXAA does a great job in isolating the high contrast pixels and blending them away. It's an approach to anti-aliasing that we've yet to see explored this completely in any other post-process technology we've looked at thus far:

An example of how FXAA strategically blurs detail that causes pixel-popping while in motion, as chosen by author Timothy Lottes. Click on the images to see the full PNG images - the downscaled thumbnails aren't the best way to judge the difference. The left image is the original, while on the right we see the FXAA-processed version.

The advantages of post-process AA are numerous. Deferred rendering techniques - which are becoming increasingly commonplace - do not play nicely with traditional multi-sample AA under DirectX 9 and while this was resolved to an extent in DX10 and DX11, the memory implications required can be quite scary and often unviable (put this way: there's a very good reason Dead Space and its sequel have no anti-aliasing - even on PC). From a console perspective, the bandwidth and RAM needs of MSAA are becoming too burdensome for developers looking to push their engines to the limits of the hardware's performance.

Tagged With
Author
Richard Leadbetter avatar

Richard Leadbetter

Technology Editor, Digital Foundry

Rich has been a games journalist since the days of 16-bit and specialises in technical analysis. He's commonly known around Eurogamer as the Blacksmith of the Future.

Comments