Sign in to follow this  
IrYoKu1

Practical Morphological Anti-Aliasing on the GPU (PC and Xbox 360)

Recommended Posts

Hey guys,

After some years asking questions here and wasting everyone's time, now we are proud to give something back to the comunity :)

We have developed a very fast implementation of MLAA on the GPU, both for PC and Xbox 360. In PC it runs 11.8x faster than MSAA 8X (0.44ms on a 9800GTX+), and in the Xbox it only requires 3.79ms to perform anti-aliasing on a 720p image. For comparison, the God of War III implementation requires 20ms of a single SPU (4ms using 5 of them).

The technique will be published in GPU Pro 2 next year, but in the meantime, here you can find more information (we will upload the demo and the source code soon):
http://www.iryokufx.com/mlaa/

Cheers!,
Jorge

[Edited by - IrYoKu1 on September 28, 2010 9:46:25 AM]

Share this post


Link to post
Share on other sites
Interesting, I'm definitely curious to see the details. Is this algorithm doable with D3D 9? I have a 9-based deferred renderer that could benefit greatly post process antialiasing.

Share this post


Link to post
Share on other sites
To add to this there is a GLSL version available that I believe is similar (if not the same, not sure)if people are itching to play around with some code.
The comments are in French though.
http://igm.univ-mlv.fr/~biri/mlaa-gpu/

Share this post


Link to post
Share on other sites
Speed is one thing, but is the resulting image as good? Judging from the (very low resolution) screenshot of the HL2 pole in SuperRad's link, it's far from being as smooth as MSAA 8x.

Also, would that be a solution for AA in deferred rendering graphic engines (instead of edge detection)?

Otherwise, if it ends up to be a new standard AA technique, well amazing job guys!

Share this post


Link to post
Share on other sites
It's great to see you guys put this up! Great work!

The quality of this technique will never be as good as 8x MSAA, but it's pretty darn close for a mere fraction of the cost.

Share this post


Link to post
Share on other sites
Quote:
Original post by Promit
Interesting, I'm definitely curious to see the details. Is this algorithm doable with D3D 9? I have a 9-based deferred renderer that could benefit greatly post process antialiasing.


While our PC version is for DX10, it is definitely not tied to it, as we are not using any of their special features. Furthermore, the Xbox version runs using DX9.

Quote:
Original post by SuperRad
To add to this there is a GLSL version available that I believe is similar (if not the same, not sure)if people are itching to play around with some code.
The comments are in French though.
http://igm.univ-mlv.fr/~biri/mlaa-gpu/


Please note that the work you mention is concurrent with ours, and totally independent (despite the obvious name coincidence).

Furthermore, that approach can't compete with MSAA in terms of performance. We are considerably faster: 0.44ms for a 720p image in a 9800GTX+ vs 3.49ms for a 1248x1024 in a GTX295 (we are using a slightly lower resolution but a considerably weaker GPU).

Quote:
Original post by Dunge
Speed is one thing, but is the resulting image as good? Judging from the (very low resolution) screenshot of the HL2 pole in SuperRad's link, it's far from being as smooth as MSAA 8x.


Please check the image in our project page :)

Quote:
Original post by Dunge
Also, would that be a solution for AA in deferred rendering graphic engines (instead of edge detection)?


Yes, to say the truth, it was the main goal. But afterwards we noticed we were considerably faster than MSAA, so its universally applicable.

Quote:
Original post by Dunge
Otherwise, if it ends up to be a new standard AA technique, well amazing job guys!


We expect so :)

Quote:
Original post by allingm
It's great to see you guys put this up! Great work!

The quality of this technique will never be as good as 8x MSAA, but it's pretty darn close for a mere fraction of the cost.


Thanks! To say the truth, when the technique works, it is as good as 16x. When it breaks it is as bad as 1x. We are currently improving the edge detection, which should considerably improve the quality; we are much faster than MSAA so there is enough room for improvements there, trading off performance for quality.

A colleage of mine will post here a comparison of MSAA vs MLAA, so that you can see the difference.

And don't miss the movie:
http://www.iryokufx.com/mlaa/demo.mp4

Comes with cool music inside =)

[Edited by - IrYoKu1 on September 28, 2010 4:52:33 PM]

Share this post


Link to post
Share on other sites
It's of course worth mentioning that if HDR is used, MLAA will pretty much always look better than standard MSAA approaches in the high contrast areas (since the resolve is done after the tone map).

Anyway I'm looking forward to poking through the code once you guys have it posted.

Share this post


Link to post
Share on other sites
Quote:
Original post by IrYoKu1


Please note that the work you mention is concurrent with ours, and totally independent (despite the obvious name coincidence).

Furthermore, that approach can't compete with MSAA in terms of performance. We are considerably faster: 0.44ms for a 720p image in a 9800GTX+ vs 3.49ms for a 1248x1024 in a GTX295 (we are using a slightly lower resolution but a considerably weaker GPU).



Apologies, I didn't want to appear to be undermining your post, I'm just glad work is being continued on getting a viable GPU implementation of MLAA, as it really is quite nice when it works, and only requiring a colour render loop makes it easy to add to games.
I'm looking forward to the demo :)

Share this post


Link to post
Share on other sites
Quote:
Original post by SuperRad
Apologies, I didn't want to appear to be undermining your post, I'm just glad work is being continued on getting a viable GPU implementation of MLAA, as it really is quite nice when it works, and only requiring a colour render loop makes it easy to add to games.
I'm looking forward to the demo :)


No prob, we just wanted to clarify that :)


Here you have the comparison between 8x and our technique:
http://www.iryokufx.com/mlaa/comparison.zip

Share this post


Link to post
Share on other sites
Wow, the comparison is amazing, especially at the bars in the top right of the image you can really see how much better the new approach looks. One of the main things is that MSAA on rendertargets(FBOs) is still alot slower than on the main framebuffer. Since yours is a postprocess it should be really fast no matter where I render to!

Share this post


Link to post
Share on other sites
Quote:
Original post by mokaschitta
at the bars in the top right of the image you can really see how much better the new approach looks
I'm guessing those bars are rendered using an alpha-tested texture (without alpha-to-coverage), which would explain why MSAA doesn't seem to soften them at all.

Share this post


Link to post
Share on other sites
Quote:
Original post by Hodgman
Quote:
Original post by mokaschitta
at the bars in the top right of the image you can really see how much better the new approach looks
I'm guessing those bars are rendered using an alpha-tested texture (without alpha-to-coverage), which would explain why MSAA doesn't seem to soften them at all.


Yeah, right :)

Share this post


Link to post
Share on other sites
Quote:
Original post by Hodgman
Quote:
Original post by mokaschitta
at the bars in the top right of the image you can really see how much better the new approach looks
I'm guessing those bars are rendered using an alpha-tested texture (without alpha-to-coverage), which would explain why MSAA doesn't seem to soften them at all.


Yeah, that's the case, the bars are alpha tested, so they aren't antialiased with MSAA. Maybe it's not the most fair example, but we chose it because the image was cool. In the movie there are other examples to look at.

Share this post


Link to post
Share on other sites
Speak of the devil,

I just happened to I think be looking for a similar (albeit CPU / meager) solution for image processing purposes. And just happened to have just made a post (http://www.gamedev.net/community/forums/topic.asp?topic_id=586188) on this very same board before checking out this thread in a tab I'd opened up.

Feel free to drop in anytime.

Share this post


Link to post
Share on other sites
[quote name='SuperRad' timestamp='1285671733' post='4712294']
To add to this there is a GLSL version available that I believe is similar (if not the same, not sure)if people are itching to play around with some code.
The comments are in French though.
[url="http://igm.univ-mlv.fr/~biri/mlaa-gpu/"]http://igm.univ-mlv.fr/~biri/mlaa-gpu/[/url]
[/quote]

Did you try this one? I want to convert this from GLSL to HLSL... Is this is an easy job??
Any comments will be appreciated

Share this post


Link to post
Share on other sites
[quote name='marwalamey' timestamp='1295357455' post='4760695']
[quote name='SuperRad' timestamp='1285671733' post='4712294']
To add to this there is a GLSL version available that I believe is similar (if not the same, not sure)if people are itching to play around with some code.
The comments are in French though.
[url="http://igm.univ-mlv.fr/~biri/mlaa-gpu/"]http://igm.univ-mlv.fr/~biri/mlaa-gpu/[/url]
[/quote]

Did you try this one? I want to convert this from GLSL to HLSL... Is this is an easy job??
Any comments will be appreciated
[/quote]

I based my initial hlsl implementation off of that and found it relatively easy to work through. You can take a look at my experiments (including the hlsl code) with mlaa here: [url="http://divergentcoder.com/tag/antialiasing/"]http://divergentcode...g/antialiasing/[/url]
I'm more than happy to answer any questions about it as well.

Share this post


Link to post
Share on other sites
I know this thread is quite old and MLAA is an important and great bit of tech. The only issue I see is this part "in the Xbox it only requires 3.79ms to perform anti-aliasing on a 720p image"
Regardless of the quality you can best compare this with the memory requirements of 2xMSAA on the Xbox, there is some confusion for me with which MSAA on the Xbox is being compared.
8xMSAA? this is not possible, or maybe impractical for this platform. 3.79ms is quite a large amount of time 11% @ 30fps. The obvious advantage of MLAA on PS3 is that it can be done on the cell processor.

I am wondering how this implmentation of MLAA compares to 2xMSAA and 4xMSAA on the Xbox.

Keep up the good work!

edit - ok re-reading this I guess the tests are alreay 4xmsaa on xbox?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this