Demo (Around 109 MB) Thanks to Crytek for making their version of Sponza freely available.

Update:

I was going to take a break away from this but ended up messing around with it anyway. In playing around with it I noticed an error in the edge length propagation routine. You can download the updated shader code here.

This is a somewhat more optimized DX10 implementation of Morphological Antialiasing than my last implementation. I have tweaked the edge length calculation following the example of another demo released online, and following that demo, again, I make use of the texture filtering hardware to do the final blending. I have also limited the edge length calculation to only go up to 20 pixels in any of the four directions; it seems from playing around with the technique that you get quickly diminishing returns for better detection of long edges.

Compared to my last demo this one is also a little more interesting in that it provides you with an interactive scene that you can move around through, giving a better feel for how the technique holds up in a game than a static screenshot would be able to do. Because of this, I have also tweaked the edge detection to take in to consideration depth information. I have also provided the option to enable/disable 4x MSAA in order to compare it with MLAA as well as to see how they look combined.

Controls:

1 - Disable MLAA
2 - Enable MLAA
3 - Disable MSAA
4 - Enable MSAA
E - View base edge detection (only when MLAA is active)
L - View edge length output (only when MLAA is active)
Mouse - Control camera view (hold left mouse button down)
W/A/S/D - Control camera movement

When you close the program it will spit out a a simple text file giving you some basic timing values for any of the four possible combinations of antialiasing modes you ran. My results for the starting camera position are as follows:

On a Geforce 9600 M:

Average Frametime (No AA): 44.891354 ms
Average Frametime (MLAA): 50.024765 ms
Average Frametime (MSAA 4x): 54.634144 ms
Average Frametime (MSAA 4x & MLAA): 60.489189 ms

On a Radeon 4850:

Average Frametime (No AA): 7.172451 ms
Average Frametime (MLAA): 9.933811 ms
Average Frametime (MSAA 4x): 7.921433 ms
Average Frametime (MSAA 4x & MLAA): 10.889030 ms

Interestingly, at least for the starting camera, the demo runs faster using MLAA than it does with MSAA on my laptop video card; however, on my desktop card it is still slower by about 2 ms. I am sure this can be optimized further.

Putting this demo together provided some good test material for my toy engine and pushed me to integrate a number of improvements. Notably, I integrated DevIL for texture loading and Assimp for model loading. While both integrations are obviously functional, I am definitely not satisfied with it as is and I will be looking to do some refactoring in the future. Implementing this demo also made it clear how nice it would be to have even a rudimentary UI framework in place - so that will be something I will be looking at implementing as well.