Important Information
- This technique has been upgraded, checkout our newer SMAA technique!
- In order to avoid further confusion between the different MLAA implementations, we named ours Jimenez's MLAA. We encourage referring to our technique with this name.
News
- February 14th, 2012Jimenez's MLAA featured on Phoronix
- October 26th, 2011Raving Rabbids Alive and Kicking (Xbox 360) is using Jimenez's MLAA on some levels!
- August 26th, 2011Jimenez's MLAA integrated on MESA!
- July 16th, 2011Jimenez's MLAA featured on Digital Foundry and GamesIndustry.biz
- June 2th, 2011Jimenez's MLAA featured on the the June/July 2011 Game Developer Magazine issue: Destroy All Jaggies.
- May 31, 2011Torque 3D 1.1 features Jimenez's MLAA!
- April 20, 2011We setup a github project, to ease upgrading to new versions (check out the diffs in the downloads section!). For previous versions, only a commit per release, but we will hopefully have something better for future relases.
- March 15, 2011Version 1.5 released. Don't miss it!
- March 5, 2011Version 1.4 released, including a brand new DX9 port, check it out!
- February 28, 2011We are happy to announce that we are releasing the original GPU Pro 2 MLAA source code.
- October 27, 2010New image gallery and links section.
- October 4, 2010We now have a F.A.Q. Check it out!
- September 6, 2010Web launched!
Abstract
Multisample anti-aliasing (MSAA) remains the most extended solution to deal with aliasing, crucial when rendering high quality graphics. Even though it offers superior results in real time, it has a high memory footprint, posing a problem for the current generation of consoles, and it implies a non-negligible time consumption. Further, there are many platforms where MSAA and MRT (multiple render targets, required for fundamental techniques such as deferred shading) cannot coexist. The majority of alternatives to MSAA which have been developed, usually implemented in shader units, cannot compete in quality with MSAA, which remains the gold standard solution. This work introduces an alternative anti-aliasing method offering results whose quality lies between 4x and 8x MSAA at a fraction of its memory and time consumption (see below). Besides, the technique works as a post-process, and can therefore be easily integrated in the rendering pipeline of any game architecture.
The technique is an evolution of the work "Morphological Antialiasing", which is designed for the CPU and unable to run in real time. The method presented here departs from the same underlying idea, but was developed to run in a GPU, resulting in a completely different, extremely optimized, implementation. We shift the paradigm to use texture structures instead of lists, which in turn allows to handle all pattern types in a symmetric way, thus avoiding the need to decompose them into simpler ones, as done in previous approaches. In addition, pre-computation of certain values into textures allows for an even faster implementation.
The algorithm detects borders (either using color or depth information) and then finds specific patterns in these. Anti-aliasing is achieved by blending pixels in the borders intelligently, according to the type of pattern they belong to and their position within the pattern. Pre-computed textures and extensive use of hardware bilinear interpolation to smartly fetch multiple values in a single query are some of the key factors for keeping processing times at a minimum.
Typical execution times are 3.79 ms on Xbox 360 and 0.44 ms on a nVIDIA GeForce 9800 GTX+, for a resolution of 720p. Memory footprint is 2x the size of the backbuffer on Xbox 360 and 1.5x on the 9800 GTX+. Meanwhile, 8x MSAA takes an average of 5 ms per image on the same GPU at the same resolution, 1180% longer (i.e. processing times differ by an order of magnitude). The method presented can therefore challenge the current gold standard in real time anti-aliasing.
More details found in the GPU Pro 2 chapter and in Destroy All Jaggies in the June/July 2011 Game Developer Magazine issue.
Xbox360 | GeForce9800GTX+ | ||||
Avg. | Std. Dev. | Avg. | Std. Dev. | Speed-up | |
Assasin's Creed | 4.37ms | 0.61ms | 0.55ms | 0.13ms | 6.31x* |
Bioshock | 3.44ms | 0.09ms | 0.37ms | 0.00ms | n/a |
Crysis | 3.92ms | 0.10ms | 0.44ms | 0.02ms | 14.80x |
Dead Space | 3.65ms | 0.45ms | 0.39ms | 0.03ms | n/a |
Devil May Cry 4 | 3.46ms | 0.34ms | 0.39ms | 0.04ms | 5.75x |
GTA IV | 4.11ms | 0.23ms | 0.47ms | 0.04ms | n/a |
Modern Warfare 2 | 4.38ms | 0.80ms | 0.57ms | 0.17ms | 2.48x* |
NFS Shift | 3.54ms | 0.35ms | 0.42ms | 0.04ms | 14.84x |
Split/Second | 3.85ms | 0.27ms | 0.46ms | 0.05ms | n/a |
S.T.A.L.K.E.R. | 3.18ms | 0.05ms | 0.36ms | 0.01ms | n/a |
Grand Average | 3.79ms | 0.33ms | 0.44ms | 0.05ms | 11.80x |
Average times and standard deviations for a set of well-known commercial games. A column showing the speed-up factor of our algorithm with respect to 8x MSAA is also included for the PC/DirectX 10 implementation. Values marked with * indicate 4x MSAA, since 8x was not available, and the grand average of these includes only values for 8x MSAA.
Figures showing our technique in action. Check out our image gallery for comparisons between 1x MSAA, 8x MSAA and MLAA. First and second images, from Fable III, courtesy of Lionhead Studios - Microsoft Game Studios. Third image, from Unigine Heaven Benchmark, courtesy of Unigine Corporation.
Movie
IMPORTANT: designed to viewed in HD at full screen.
Downloads
- Precompiled Demo [14.38 MB]
- Additional Images [0.00 ]
- Movie [191.93 MB]
-
Important Information
-
Note that the repository name changed from 'jimenez-mlaa' to 'smaa', as SMAA builds on top of Jimenez's MLAA, and we preferred to use the same repository for both. It is strictly superior in quality and performance, so there is no reason for using Jimenez's MLAA anymore.
Github Repository
Direct Links
- For newer versions, checkout SMAA.
-
1.5 (March 15, 2011): added a bunch of optimizations suggested by Weibo Xie, thanks a lot! We now also sport a better color edge detection, by working with real sRGB gamma-corrected values for calculating lumas.
Download Diff with v1.4 -
1.4 (March 5, 2011): DX9 version, improved pattern blending, better area textures, enhaced the MLAA class interface (now it allows to specify external storage, just in case you have spare render targets) and various minor fixes.
Download Diff with v1.3 -
1.3 (February 28, 2011): initial release.
Download
Misc
2 Check out this diff for an example of usage (integration into the DX SDK Deferred Particles example). We frozen this all-in-one .h in version v1.5; it can still be used to quickly try our technique, but we strongly encourage to switch to latest github version as it will contain important improvements.
-
1 If the additional images are put in the same folder as the demo executable, they will be automatically loaded by the application (more info in the README). For running the demo, an installation of the June 2010 DirectX SDK is required.
F.A.Q.
How were the times measured for the Xbox 360 version?
We captured frames from the games listed in the table, and processed them running a XNA version of our technique on a real Xbox 360. Using a proper dev-kit would probably lead to better times.
How does the quality of your implementation compare with MSAA?
In the article we are conservative, and we say that quality is between 4x and 8x. However, it is something difficult to compare: when the technique works it is as good as 16x, when it breaks it is as bad as 1x. As the performance of our approach is one order of magnitude faster than MSAA, there is still room for quality enhancements, in expense of worser running times.
In which platforms does it run?
We have implementations in DirectX 10, for PC, and XNA, for Xbox 360. It could run in DirectX 9 without problems, as we are not using DirectX 10 special features. It is coded as a regular pixel shader, that runs as a post-process over a color image (with optionally depth as input).
What are the advantages of MLAA over MSAA?
- For similar quality, it is considerably faster, one order of magnitude in the PC case.
- For consoles, where the MSAA sample count is limited due to hardware restrictions, it allows better quality.
- It enables the usage of anti-aliasing in conjunction with Multiple Render Targets, which is specially useful for deferred engines.
- It can provide better quality when HDR is used, as anti-aliasing is performed after tone mapping.
- Anti-aliasing quality can be dynamically adjusted on the fly, depending on the available resources at each frame.
- MLAA is not incompatible with MSAA: this leads to hybrid MSAA-MLAA approaches.
Bibtex
@inbook{JIMENEZ2011_GPUPRO2A, author = {Jorge Jimenez and Belen Masia and Jose I. Echevarria and Fernando Navarro and Diego Gutierrez}, editor = {Wolfgang Engel}, title = {{GPU} Pro 2}, chapter = {Practical Morphological Anti-Aliasing}, publisher = {{AK} Peters Ltd.}, year = {2011}, }
@inproceedings{JIMENEZ2011_SIGGRAPH11, author = {Jorge Jimenez and Diego Gutierrez and Jason Yang and Alexander Reshetov and Pete Demoreuille and Tobias Berghoff and Cedric Perthuis and Henry Yu and Morgan McGuire and Timothy Lottes and Hugh Malan and Emil Persson and Dmitry Andreev and Tiago Sousa}, title = {Filtering Approaches for Real-Time Anti-Aliasing}, booktitle = {ACM SIGGRAPH Courses}, year = {2011}, }
@article{JIMENEZ2012_CGF, author = {Jorge Jimenez and Jose I. Echevarria and Tiago Sousa and Diego Gutierrez}, title = {SMAA: Enhanced Morphological Antialiasing}, journal = {Computer Graphics Forum (Proc. EUROGRAPHICS 2012)}, year = {2012}, volume = {31}, number = {2}, }
Related
- 2011: Filtering Approaches for Real-Time Anti-Aliasing
- 2012: SMAA: Enhanced Subpixel Morphological Antialiasing
Links
- Buy the book in Amazon!
- Buy the June/July 2011 Game Developer Magazine issue!
- February 14th, 2012: Morphological Anti-Aliasing With Mesa 8.0
- August 26th, 2011: Jimenez's MLAA integrated on MESA (Git Commit)
- July 16th, 2011: The Future of Anti-Aliasing (Digital Foundry)
- June 29, 2011: MLAA heads for 360 and PC (GamesIndustry.biz)
- October 26, 2010: God of War AA coming to PC/360? (Digital Foundry)
- April 18, 2010: More on God of War III Antialiasing (Real-Time Rendering)
- March 31, 2010: Morphological Antialiasing in God of War III (Real-Time Rendering)
- January 16, 2010: The Anti-Aliasing Effect (Digital Foundry)