No, I am not here to flame FXAA (that much) this time.
The development is being continued by Timothy Lottes
, the guy who came up with the idea and he seems to completely realize the inherent flaws of FXAA, with the newest FXAA version 4.0 being much more compatible with other antialiasing algorithms for better subpixel accuracy. Since Battlefield 3 came with both MSAA and FXAA and delivered pretty nice results (the best of both worlds, except for performance of course) and since FXAA is very effective at removing jaggies, I now have a little more faith in post antialiasing. FXAA 4 looks like it slightly improves the quality of 4xMSAA, and also has some really amazing support for scaling images, allowing you to both increase and decrease the resolution while getting very VERY nice smooth edges. Due to the simplicity of the FXAA filter (only a single fullscreen shader pass) it would be possible to easily combine it with Dynamic Resolution Rendering
for real-time adaption of quality vs performance. It also uses a temporal SSAA filter to reduce temporal AA (e.g. shimmering, which FXAA doesn't improve much at all) which increases subpixel accuracy, similar to what the dynamic resolution article mentioned.
- Reducing the size of the render target will increase severity of the shimmering even more of course, and it might not be good to dynamically lower the resolution too much.
- Similarly, increasing the size of the render target (= fractional ordered grid supersampling) requires n^2 more pixels for n more shades of samples, which is why MSAA and SSAA use jittered or rotated sample locations. 2x2 OGSSAA = 4x the number of pixels, while 2x Rotated Grid SSAA is only 2x the number of pixels but almost identical quality.
- FXAA is still not compatible with MSAA or SSAA with better sample patterns than ordered grids, requiring a downsample for MSAA before processing. Ideally, we want to blur between samples in that case, not between resolved pixels.
- Supersampling is also insanely expensive even at low sample numbers. I mean, if it was fast in the first place, we wouldn't be using anything else, so combining a very fast FXAA filter with insanely slow, badly scaling SSAA is a pretty cheap trick for improving the quality of FXAA.
- There's a reason why temporal SSAA is rare: severe ghosting. Again, we're just getting blurring, but this time between frames, not between pixels.
- Dynamic resolution can give an expensive but often missing supersampling feature in games, and the built-in high-quality antialiasing scaling of FXAA 4 is obviously extremely well matched for both upsampling and downsampling (see Timothy's blog).
- FXAA 4 works on not only screen aligned jaggies, but even on blurred and bilinearly filtered aliasing too now (but how this actually looks in motion is unknown ATM).
- Better compatibility with other antialiasing algorithms. The main problem with low SSAA is the low sample count (due to the performance cost) resulting in a bad gradient, which can be solved by applying FXAA to the supersampled image. Even 4xMSAA receives a noticeable improvement in gradients.
- Performance! Fast as hell! It currently claims that "a mid-range 560 Ti is likely able to process a 1080p frame in around 0.36 ms."!
- Uses motion vectors for the temporal SSAA, which reduces ghosting a little bit. This is pretty much free since you need those motion vectors for motion blur anyway.
My point is that FXAA is moving in the right direction. I've never been skeptical about post-processing antialiasing, but rather how they are branded as a replacement for tradition antialiasing. I don't know how much this actually will improve the temporal aliasing situation that the old FXAA algorithm failed to do much about, but the author is realizing that this is the main problem of FXAA and is working on solutions for it. We are finally seeing a realistic contestant/improver to MSAA and SSAA, which in the end might improve antialiasing in games to come. My current ideal solution to aliasing is no longer insane amounts of supersampling and/or multisampling but MSAA + FXAA + dynamic resolution SSAA. Now, if we could only get support for FXAA on unresolved MSAA, we could be looking at a revolution in realtime antialiasing. This is even more exciting than when I found the combined MSAA/SSAA antialiasing modes in the NVidia drivers.