Fast Approximate Anti-Aliasing (FXAA)

The problem with FXAA is that it tends to blurs textures and other items that shouldn’t be blurred by its very nature.

ATI use a similar form of AA called “Morphological Anti-aliasing” (MLAA). It has exactly the same idea of FXAA - run a shader pass over the entire image and clean up highly contrasting parts. It also blurs textures and aliasing. The difference between FXAA and MLAA is that MLAA is run after then entire scene is drawn. That means that text, hud elements, etc are also slightly blurred. However, it can be theoretically used for any game.

MSAA doesn’t blur shaders unlike MLAA/FXAA which is a credit to them too.

FXAA is a pretty neat idea around for underpowered systems, and especially consoles and handhelds, but since I have the horsepower to enable 4xMSAA on practically every game, and 8xMSAA on most of them, I much prefer to use these forms of AA. True that MSAA doesn’t affect the shaders, but I don’t notice it most of the time anyway.

About SMAA - That’s pretty neat. I did notice that Crysis 2 had a very sweet AA going on and it seemed pretty fast too. I’ll have to look into SMAA more. From what I’ve seen though, I would love for it to appear in a diver update for my Nvidia GTX 560Ti

@Iain Peet: The problem with computer graphics is, that the signal is not band-limited and therefore the nyquist-theorem doesn’t hold. Imagine the simple step function (one black pixel adjacent to a white pixel). This function is not band-limited and therefore you cannot sample at a high enough rate to correctly reconstruct the signal.

Therefore, the bitter truth for computer graphics is that anti-aliasing is always a bit of a “hack” - you can only approximate the truth. But that’s not too much of a problem since in computer graphics (especially games) it only has to “look good” not “correct” (in the mathematical sense).

As a result, it makes most sense to treat computer graphics within an error-framework rather than the “nyquist-framework”. It’s better to ask the question “how close am I to the truth?” instead of “How do I reconstruct the truth?”

I recommend Michael Unser’s excellent paper “Sampling - 50 Years After Shannon” for a very nice theoretical background overview on that topic.

@Chris: That’s a limitation of ATI’s driver level implementation of MLAA.

Toms Hardware had a very summary of the whole anti alias stuff:
http://www.tomshardware.com/reviews/anti-aliasing-nvidia-geforce-amd-radeon,2868-3.html

For myself I think this anti alias is complete unnessary. The resolution of the monitors is already almost that high, that it is very hard two distinguish pixels (depends of course of your setup, like screen size, dpi, viewing distance, etc…). But if I would get the impression that there are too much aliasing artifacts I have an very easy solution
(which not every can do): I wear (weak) glasses. I just put them off, afterwards everything I can still see fine, but its slightly smoothed => no stairs :wink:

FXAA is a clever technique but in practice is not nearly as good as mentioned in this article. It might look good on screenshots but it does little to eliminate temporal artifacts due to aliasing.

The reason is simple: it doesn’t have enough information to work with as visibility is evaluated only once per pixel. FXAA won’t do much for sub-pixel features.

Obviously this doesn’t make FXAA a useless technique but there is no free lunch in computer graphics and if you want to eliminate the byproduct of an insufficient sampling rate (aliasing) you need to increase the sampling rate one way or another.

FXAA does this implicitly by reconstructing a signal making certain assumptions, when those assumptions fail FXAA (or any other AA technique) fails.

BTW, unlike what is mentioned in this article MSAA is imo way less hacky than FXAA, it’s actually a very good way of attacking the problem and it is much more effective than many post-processing techniques in reducing the amount of spatial and temporal aliasing. MSAA and variations of it are here to stay because it is a clever way of handling anti-aliasing without increasing too much the cost of shading.

FXAA and similar approaches are so cheap and easy to use but on the long run techniques that properly decouple visibility from shading and that handle visibility at higher rates are the way to go and the video linked by smithee shows this very well given that the AA methods based purely on post-processing the image clearly do a terrible job at eliminating temporal aliasing.

The opinions expressed herein are my own personal opinions and do not represent my employer’s view in any way

Pretty much all “modern” anti-aliasing is some variant of the MSAA hack, and even that costs a quarter of your framerate. That’s prohibitively expensive, unless you have so much performance you don’t even care, which will rarely be true for any recent game. While the crawling lines of aliasing do bother me, I don’t feel anti-aliasing alone is worth giving up a quarter of my framerate and/or turning down other details to pay for it.

Well, I don’t know about that.

Given that we don’t need to tie mouse polling to frame scan these days, and that anything over, say, 60 fps won’t really be noticeable, how much do we really need? Are you sure you’re actually hitting framerate barriers that matter, now?

(Ie, given that many games cap at 60, and many monitors don’t do faster than 60-76hz refresh, losing 25% of your, say, 100fps gets you… still faster than it’ll display. And still faster than you’ll be able to see, most of the time if ever.)

A $199 video card can run full-HD, high-detail, 4xAA (16x oversample) at a framerate fast enough that I don’t notice the rate - which is all that matters.

Given the slow adoption of greater-than-HD display sizes, GPU power is making the “problem” of AA go away at the moment; perhaps this will change when you can get the 27" super-HD monitors for a sane price.

Things has been changed a lot on picture quality from Video quality to HD is a long way. when I saw black and white movie and 80’s color print I feel at that time everybody was fancy for that quality which is not acceptable in today’s video. technology is changing over everyday and today’s HD may not remain same in future.

Javin

Not sure this is a product of “attacking a problem from a different angle” as it is a case of “new technology finally made it a viable solution.”

There were age-old AA methods using final-scene pixel filters 20 yrs ago. The main problem was that they were actually much slower (back then) than doing poly-edge AA. This because both the cost of per-pixel filtering was very expensive and also because poly counts were much lower, so edge-aliasing made a mot more sense on a bandwidth level as well.

Furthermore, increased texture res helps the filters out as well: the effect it had on the (often blocky and low-res) textures wasn’t particularly inspiring, and you’d spend your time trying to have the filter account for that (unsuccessfully). Nowdays, it is no longer a concern. (yay!)

I somehow fail to see how running a edge-detecting blur filter via pixel shader is that great of an achievement. I mean, trying this is obvious, isn’t it? Also, it won’t improve actual quality, it will just blur the high frequency parts, even inside textures.
Or am I missing something?

Shannon’s sampling theorem tells us that at a given sampling frequency f, the sample can exactly represent the signal up to the Nyquist frequency, which is f/2.

The problem is not that the screen is too low resolution, if you can’t see the individual pixels. The problem is that the signal is aliased, which means that it contains components with a frequency (detail level) too high for the screen. The correct answer is not to smooth the image after you have created it; that will lower the Nyquist frequency of the image, but not improve the original signal.

The correct answer is to reduce the frequency of the signal. This means doing MPAA to get the higher-res sampling (and capture the original signal better) then do Guassian convolution over the image, before finally sampling that for the screen.

All you have with FXAA is vaseline on the screen.