Single page Print

Some antialiasing improvements
Nvidia has revealed a couple of new wrinkles in its antialiasing capabilities to go along with Kepler's introduction. The first of those relates to FXAA, the post-process antialiasing technique that has been adopted by a host of new games in recent months.

FXAA is nifty because it costs very little in terms of performance and works well with current game engines; many of those engines use techniques like deferred shading and HDR lighting that don't mix well with traditional, hardware-based multisampling. At the same time, FXAA is limited because of how it works—by looking at the final, rendered scene, identifying jaggies using an edge-detection algorithm, and smoothing them out. Such post-process filters have no access to information from the sub-pixel level and thus do a poor job of resolving finely detailed geometry. They can also cause the silhouettes of objects to shift and crawl a bit from one frame to the next, because they're simply guessing about the objects' underlying shapes. (You'll see this problem in the complex outlines of a gun in a first-person shooter.) Still, this brand of antialiasing is a darn sight better than nothing, which is what PC gamers have had in way too many games in recent years.

During the Kepler press event, Nvidia claimed "FXAA was invented at Nvidia," which is technically true, but is kind of like claiming the producers of Keeping up with the Kardashians invented pimping. They didn't invent it; they just perfected it. I believe Alexander Reshetov at Intel Labs was the first to describe (PDF) this sort of post-process reconstruction filter. AMD later implemented MLAA in its Catalyst drivers when it introduced the Radeon HD 6800 series. Nvidia did the world the great service of developing and releasing its own variant of MLAA, which looks good and is very fast, in a form that's easy for developers to integrate into their games. FXAA has since become very widely adopted.

FXAA softens all edges effectively in Skyrim.

The big news with Kepler is that Nvidia is finally integrating an FXAA option into its control panel, so end users can force on FXAA in games that wouldn't otherwise support it. The disadvantage of using the control panel to invoke this feature is that FXAA's edge smoothing will be applied to all objects on the screen, including menus and HUDs. Games that natively support FXAA avoid applying the filter to those elements, because it can cause some blurring and distortion. The upside, obviously, is that games with poor antialiasing support can have FXAA added.

I tried forcing on FXAA in one of my old favorites, Borderlands, which has always desperately needed AA help. To my surprise, the results were uniformly excellent. Not only were object edges smooth, but the artifacts I've noticed with AMD's MLAA weren't present. The text in menus didn't have strangely curved lines and over-rounded corners, and black power lines against a bright sky weren't surrounded by strange, dark halos. FXAA is superior to MLAA in both of these respects.

Post-process filters like this one may be a bit of a cheat, but the same can be said for much of real-time graphics. That's fine so long as the illusion works, and FXAA can work astonishingly well.

Building on the success of FXAA, Nvidia has another antialiasing method in the works, dubbed TXAA, that it hopes will address the same problems with fewer drawbacks. TXAA isn't just a post-process filter; instead, it combines low levels of multisampling with a couple of other tricks.

The first of those tricks is a custom resolve filter that borrows subpixel samples from neighboring pixels. We've seen custom filters of this sort before, such as the tent filters AMD introduced way back in its Radeon HD 2000-series cards. Routines that reach beyond the pixel boundary can provide more accurate edge smoothing and do an excellent job of resolving fine geometric detail, just as AMD's CFAA tent filters did. However, they have the downside of slightly blurring the entire screen. I kind of liked AMD's narrow tent filter back in the day, but most folks reacted strongly against the smearing of text and UI elements. Sadly, AMD wound up removing the tent filter option from its drivers for newer Radeons, though it's still exposed in the latest Catalysts when using a Radeon HD 5870. TXAA is distinct from AMD's old method because it's not a tent filter; rather than reducing the weight of samples linearly as you move away from the pixel center, TXAA may potentially use a bicubic weighting function. That should, in theory, reduce the amount of blurring, depending on how the weighting is applied.

TXAA has two basic quality levels, one based on 2X multisampling and the other based on 4X MSAA, both with custom resolve. The key to making TXAA effective will be ensuring that the resolve filter is compatible with deferred shading and HDR lighting, so it will be able to touch every edge in a scene, not just a subset, as too often happens with multisampling these days. Because this resolve step will happen in software, it will not take advantage of the MSAA resolve hardware in the GPU's ROP units. Shader FLOPS, not ROP throughput, will determine TXAA performance.

The other trick TXAA employs will be familiar to (former?) owners of Radeon X800 cards. The "T" in TXAA stands for "temporal," as in the temporal variation of sample patterns. The idea is to increase the effective sample size for antialiasing by switching between different subpixel sample patterns from frame to frame. Back in the day, we found ATI's implementation of this feature to create a "fizzy" effect around object edges, but that was long enough ago that the world was literally using a different display technology (CRTs). LCDs may tolerate this effect more graciously. Also, we expect Nvidia may use subtler variance in its sample patterns in order to avoid artifacts. How this method will combine with a kernel filter that reaches beyond the pixel boundary is a very interesting question.

TXAA edge smoothing comparison. Source: Nvidia.

Nvidia claims the first TXAA mode will exceed the quality of 8X multisampling with the same performance overhead as 2X MSAA. We suspect that, with the right tuning, the combination of techniques Nvidia intends to use in TXAA could work quite nicely—that the whole may seem greater than the sum of the parts. Then again, TXAA may fail to overcome its drawbacks, like inherent blurring, and wind up being unpopular. Will TXAA end up being regarded as Quincunx 2.0, or will it be something better? It's hard to say.

The trouble is, TXAA looks to be a moving target. For one thing, all of the information we've relayed above came with the caveat that TXAA will be highly tweakable by the game developer. Different implementations may or may not use temporal jittering, for instance. For another, TXAA is still very much a work in progress, and the folks at Nvidia who we interviewed admitted some of the specifics about its operation have yet to be decided, including the exact weighting method of the resolve filter.

Nvidia did have one live demo of TXAA running at its Kepler press event, but we don't have a copy of the program, so we can't really evaluate it. TXAA will initially be distributed like FXAA, as something game developers can choose to incorporate into their games. The feature may eventually find its way into a control panel option in Nvidia's graphics drivers, but I wouldn't hold my breath while waiting for it. We probably wont get to see TXAA in action until games that use it arrive. The first title may be the upcoming MMO Secret World, which is slated to ship in June. After that, Borderlands 2 should hit this September with TXAA support. Nvidia tells us both Crytek and Epic are working with TXAA, as well.

Since it is entirely a software algorithm, TXAA could in theory work on Fermi-based GPUs, as well as Kepler. However, Nvidia's story on whether it will enable TXAA on Fermi-derived products seems to be shifting. We got mixed signals on this front during the Kepler press event, and the latest information we have is that TXAA will not be coming to Fermi cards. We think this sort of artificial limitation of the technology would be a shame, though, so here's hoping Nvidia has a change of heart. One thing we know for sure: unlike FXAA, TXAA won't work with Radeons.