Ever on the lookout for better ways to render pixels, anti-aliasing has advanced in leaps and bounds.
Even as games become ever more demanding, one factor doesn't change: the pixels on your screen only render so much detail and, limited by number of pixels and pixel spacing, edges can appear 'jaggy', even with today's 1080p monitors.
The solution for well over a decade now has been a process known as anti-aliasing (AA), whereby edges are smoothed by approximating the data of nearby pixels via often complex algorithms. And therein lies the kicker -- anti-aliasing can make images look fantastic in gaming, but it comes with a performance cost. The more anti-aliasing applied the better the result and the slower the game will often run.
The FXAA injector in Skyrim with anti-aliasing, sharpening and a subtle colour enhancement active.
While graphics cards continue to increase in performance generation after generation, games have also became ever more demanding for both CPU and GPU, and so even if you have a powerful new graphics card you might not be able to run a game with high AA without suffering a lower frames per second as AA processing slows down rendering.
A number of factors affect the performance of AA, not the least of which is resolution. A 1,920 x 1,080 display will be able to run 8x AA faster than a 2,560 x 1,600 display, and more memory is required on the video card to process the images.
There are a range of AA methods already employed by games and graphics card manufacturers -- these include multisample anti-aliasing (MSAA), coverage sampling anti-aliasing (CSAA), morphological anti-aliasing (MLAA), supersampling (SS) and sparse-grid supersampling (SGSS) among others. OGSSAA (ordered grid supersampling anti-aliasing), often just called SSAA, is the most accurate method and works by rendering the scene at a higher resolution and then sampling down to your display. While its results are excellent, it's also punishingly demanding and the reason other anti-aliasing methods exist -- they all, to some degree, sacrifice image quality for performance.
And that's where FXAA comes in. Developed by NVIDIA engineer Timothy Lottes, FXAA -- or fast approximate anti-aliasing -- takes a different approach and provides anti-aliasing as a shader, a layer that can be run on top of an image after it's been rendered. As the name suggests, its not going to provide the quality of OGSSAA, but it does provide the equivalent of 4x MSAA for less processing power. And where modern games are considered, every little bit helps.
Already some game developers have started to include FXAA modes in their options, however given the rate of change in development these are often older versions of the shader that don't look as good as the latest FXAA release.
Which leads us to the FXAA injector: thanks to enterprising programmers, modified DirectX DLLs have been released that hook to the latest release of the FXAA shader implementation and allow you to add it to any game you like. The only restriction at the moment is that the game needs to be DX9 or DX10 based – DX11 is currently not supported. But since you can count the number of DX11 games on one hand, and cutting-edge titles like The Witcher 2 and Skyrim still use DX9, there are plenty of titles you can use it with.
Installing and using the FXAA injector
1) Grab the FXAA injector. The current version can be downloaded
here (click on 'Files' to download).
2) Extract the contents to the folder of a game that contains the game's executable. Sometimes this is the parent game directory (for example c:\games\skyrim), sometimes this is a subdirectory (such a c:\games\batman\binaries).
3) Run the game's configuration options and disable any in-game anti-aliasing support. Do the same with your driver control panel.
4) Run the game! Press the 'Pause' key on your keyboard to toggle FXAA on and off.
There's another advantage to the FXAA injector: as a shader instead of a driver-based function, it's easy to manipulate it to provide other effects beyond anti-aliasing, and it's this that has seen the injector gain rapid popularity. Everything from changing colour palettes to post-processed sharpening can be applied, and the values can be easily tweaked by anyone.
One of the files extracted is called injFX_Settings.h. You can edit this file with a text editor (like Notepad) and follow the instructions there in to try different values. In some cases users have uploaded their injFX_Settings.h file for specific games (see for example bit.ly/tYpOHj and bit.ly/uvpoag on Skyrim Nexus for Skyrim).
Note that as a post-effect shader, although we recommend disabling in-game and driver-based AA, you can actually run both at the same time. In some cases 2x MSAA or 4x MSAA with FXAA can provide great results, but then you're also going to be hit with a greater performance penalty, and one of the advantages of FXAA is quality anti-aliasing with minimal performance impact. However, as with most gaming options, salt to taste!