Alternative AA methods and their comparison with traditional MSAA*

:O. Well... math is pretty much free on GPUs these days right? :p

Anyway I had another idea, which was to use a much simpler operator (basic reinhard) when doing the MSAA resolve and use a more complex operator (filmic) when doing the tone mapping for real.
Yeah I was wondering the same thing... seems like a much cheaper approximation would be good enough since using data from the last frame is already an approximation. Anything to get it closer to the final tone mapped space. Note also that if any post-processing or color grading is done on the final image that should ideally be taken into account during the resolve as well, although there's no guarantee that those operators are even invertable.
 
Here's a picture showing normal 4x MSAA with filmic tone mapping, MSAA with reinhard + inverse reinhard used during the resolve and filmic for the final tone mapping step, and MSAA with reinhard used during both the resolve as well as the final tone mapping step:

msaatonemapping.png

That's quite an intensity difference you get here and there though for the whole image? E.g. the blue darker, the rim of the bottle (?) more gray than black.
 
That's quite an intensity difference you get here and there though for the whole image? E.g. the blue darker, the rim of the bottle (?) more gray than black.

Yeah that's intentional, since that's the case where MSAA fails.
 
:O. Well... math is pretty much free on GPUs these days right? :p


Yeah I was wondering the same thing... seems like a much cheaper approximation would be good enough since using data from the last frame is already an approximation. Anything to get it closer to the final tone mapped space. Note also that if any post-processing or color grading is done on the final image that should ideally be taken into account during the resolve as well, although there's no guarantee that those operators are even invertable.

There's also one function that's guaranteed not to be invertable, which is the implicit clamp to [0,1]. So if your tone mapping operator doesn't guarantee results <= 1.0 (which many don't), then you're out of luck.
 
Hi all,

I'm one of the authors of the SMAA paper (Jorge Jimenez). There is a really interesting discussion ongoing here, so I thought it would be fantastic to participate! I'd like to clarify some issues that have been raised in this topic; for the sake of brevety, I won't quote specific comments, but rather talk in a general way.

First of all, we don't claim postprocessing AA to be a superior solution to MSAA or SSAA, because it isn't! The reality is, however, that MSAA or SAAA are too expensive in particular scenarios (see BF3 or Crysis 2). If you measure the cost of CSAA 16xQ in Crysis 1, you won't believe how expensive it can be in some cases (even on modern GPUs).

Actually, the message we wanted to communicate with SMAA is the other way around: postprocessing antialiasing cannot recover real subpixel features, as they have been already destroyed by the sampling process. So, other approaches must to be used to accurately represent subpixel features.

Some time ago, we thought: MSAA is great, but it's expensive, and doesn't work well with deferred engines. It also doesn't have great gradients unless you use high sample counts. On the other hand, postprocessing antialiasing has great gradients and is cheap. And finally, temporal supersampling is able to represent subpixel features and deal with shading aliasing.

So, why not combine them into a single technique? The core idea of SMAA is about how to accurately combine MLAA with temporal SSAA and MSAA. It's not to drop MSAA in favor of MLAA, but to leverage the advantages of very different approaches. We don't claim our technique to be the most accurate out there, as SSAA 16x and CSAA 16xQ will be more accurate, in the general case. However, we think SMAA is a good solution for a today's problem, which in our opinion, gets the quality most people is demanding. It's not an step forward with regards to CSAA or MSAA. However, it's a quality boost in the cases where these techniques can't simply be used.

Supersampling MLAA is not as trivial as it may sound: doing MSAA + FXAA or MSAA + MLAA is not good at all, and gives worse subpixel features than using MSAA alone. In the newest version of the paper (currently submmited to a journal for review), this is explained more clearly. We apologize because current technical paper is not that good at explaining things, and also doesn't show the latest results. In the final version we contextualized better some of our 'claims'. I hope you will understand that current technical paper is WIP work.

Having three different components (morphological, multisampling and temporal supersampling), they backup each other pretty well: when morphological fails because of edge detection or subpixel features, multisampling and supersampling back it up; when MSAA fails because of shader aliasing or gradients, the other two back it up; and finally, when temporal supersampling fails because of very fast motion, the other two back it up. So, the basic idea is to improve the robustness of the each method as the failure cases are covered by the other techniques. By using low sample counts we are avoiding temporal artifacts and performance penalties. Finally, by applying a very very conservative implementation of MLAA, we maintain the image as pristine as possible, so that multi/supersampling can do its work where a morphological approach fails.

Going further, we believe the deferred shading antialiasing problem will stay for a long time, or maybe forever. Supersamplingthe edges 16 times in a deferred engine (for CSAA 16xQ, for example) is probably going to always take a percentage of the resources of a GPU. As GPUs get more powerful, it's likely that more resources will be spent in more advanced shading, which will make this supersampling cost to stay similar over the years. On the other hand, SMAA 4x only requires supersampling 2 times, and the cost of running the morphological component will be lower and lower as GPUs evolve.

Regarding the movie, the scenes are chosen so that they have plenty of subpixel features. SSAA and CSAA 16xQ are shown in the movie as reference, not because our technique achieves that quality. However, we could also select real footage from games where SMAA 4x (or even 1x) would produce the same results as SSAA 16x. It all depends on the game content and style; artistic direction can sometimes hide aliasing artifacts (see the wonderful job done in Starcraft 2).

Here's the thing - if you're honestly looking at the quality of the edge gradients on single surfaces you're totally missing the point these days. There have been perfectly acceptable solutions to that for ages. That is what I call the "easy" aliasing.

I'd argue with this; there are a lot of games that are bundled without AA, with blur based AA, or even supersampling the scene because they had no other option. It took years to solve the aliasing problem in deferred engines. So, as of today there are plenty of solutions, but just past year there wasn't so many good options =)

Sorry for this rather long post, hope this will help to better understand the design decisions behind SMAA =)
 
So MSAA is a component of SMAA? How many MSAA samples do you take with 4xSMAA?

Yes, but depends on the mode:

  • SMAA 1x is our enhaced MLAA implementation.
  • SMAA T2x is temporal SSAA 2x + MLAA.
  • SMAA S2x is MSAA 2x + MLAA.
  • SMAA 4x is MLAA + TSSAA 2x + MSAA 2x.

We're working on a T4x temporal mode, but it's really hard to eliminate ghosting trails in low framerates with so many previous samples. So I'm not sure if we'll manage to obtain something usable. We'll also do another round of optimizations, there are still some ideas we want to try!
 
I'd argue with this; there are a lot of games that are bundled without AA, with blur based AA, or even supersampling the scene because they had no other option. It took years to solve the aliasing problem in deferred engines. So, as of today there are plenty of solutions, but just past year there wasn't so many good options =)
I agree on consoles, but it has been possible to make MSAA work just fine with any rendering technique on PCs since DX10.1. DX11 makes the performance hit of deferred MSAA way smaller too. Even in DX10.1 though MSAA is totally usable, just ignorance/laziness/console ports have caused it not to be implemented pretty much at all until Battlefield 3.

Anyways I'm interested in seeing a demo of your hybrid MLAA + 2x MSAA mode. Do you do anything to try and land those two samples on two unique surfaces or do you just use the standard hardware patterns? If the latter, I'd be interested in if a MLAA + 4x MSAA mode provides significantly better subpixel temporal anti-aliasing due to the more symmetric sampling pattern.
 
Last edited by a moderator:
Yes, but depends on the mode:

  • SMAA 1x is our enhaced MLAA implementation.
  • SMAA T2x is temporal SSAA 2x + MLAA.
  • SMAA S2x is MSAA 2x + MLAA.
  • SMAA 4x is MLAA + TSSAA 2x + MSAA 2x.

We're working on a T4x temporal mode, but it's really hard to eliminate ghosting trails in low framerates with so many previous samples. So I'm not sure if we'll manage to obtain something usable. We'll also do another round of optimizations, there are still some ideas we want to try!

Interesting. Thanks. :smile:

I will say this: be careful with temporal AA. It looks great in screenshots but borders on useless in motion. At least this is my experience with all the temporal AA implementations I've seen.
 
Surely you mean the other way round? In a screenshot you're only seeing half the samples if it's switching between 2 sample patterns.
 
Surely you mean the other way round? In a screenshot you're only seeing half the samples if it's switching between 2 sample patterns.
Unless it's blending samples from the previous frame on top (via reprojection caching). That one always looks amazing in screenshots since it's basically super-sampling, but suffers under quick motion (which many samples must be rejected/recomputed).
 
Surely you mean the other way round? In a screenshot you're only seeing half the samples if it's switching between 2 sample patterns.

What Andrew said. They blend the samples from the previous frame with the current frame, so it looks good in screenies but does nothing (and adds ghosting) in motion.
 
Didn't there used to be the option for an AA mode on old nVidia (FX / 6 series era) cards* that was basically 2xMSAA with two different sample patterns? It flipped between one and the other each frame to give you a 4xMSAA effect with half the cost. The drawback being that it only worked when your FPS was high enough. I thought that was called Temporal AA, but I guess I'm remembering the name wrong, or it worked in a different way to how I thought.

/edit Actually it may have been X800 cards that introduced it. Is this a different temporal AA to what you two are talking about?
 
Last edited by a moderator:
/edit Actually it may have been X800 cards that introduced it. Is this a different temporal AA to what you two are talking about?
Yes. What you describe is only giving an apparent AA increase due to persistence of vision, and the human viewer compositing the two different sets of samples. Andrew and homerdog are talking about the game actually compositing the two sets of samples in creating the framebuffer. If you imagine taking your example at 120 fps, dropping that to 60 fps and mixing every two 120 fps frames into one 60 fps frame via some special source to select which data goes where, you get temporal AA. The advantage is that there's no flicker at lower framerates unlike the simple alternating sample pattern you describe, but there can also be artefacts.
 
Alternating sample pattern temporal AA also works pretty well, if the rendering is vsynch locked to 60 fps. With anything lower than that, it looks horrible (subsample shimmering becomes visible). Free 2xSSAO is not bad (even if it doesn't show in screenshots).

At 120 fps (vsynch locked) alternate sample pattern temporal AA works even better. But I doubt we will see that on consoles (no TV set supports 120 fps input in 2d mode currently). If we are lucky next gen will bring more 60 fps games (but there will still be plenty of 30 fps games).
 
At 120 fps (vsynch locked) alternate sample pattern temporal AA works even better. But I doubt we will see that on consoles (no TV set supports 120 fps input in 2d mode currently).
Could always render two 2D stereoscopically matched frames and output as a 3D format 2D image. :D 'Better AA in 2D for 3D users' - okay, that's maybe not a good sell...
 
Anyways I'm interested in seeing a demo of your hybrid MLAA + 2x MSAA mode. Do you do anything to try and land those two samples on two unique surfaces or do you just use the standard hardware patterns? If the latter, I'd be interested in if a MLAA + 4x MSAA mode provides significantly better subpixel temporal anti-aliasing due to the more symmetric sampling pattern.

We're using the standard hardware patterns. Regarding subpixel features, using MSAA 4x + MLAA would yield similar results to MSAA 4x. MLAA does not help much with subpixel features, and if a regular approach is used it even makes things worse. We had to heavily modify MLAA to leave subpixel features alone, so that they are correctly processed by MSAA and SSAA. What MLAA would add in that case is the gradients quality, which is still very poor in 4x modes (to me). If we want something more than 4x regarding subpixel features, temporal antialiasing should be added on top of that; in the case of temporal 2x, subpixel features rendering would improve to 8x.

What Andrew said. They blend the samples from the previous frame with the current frame, so it looks good in screenies but does nothing (and adds ghosting) in motion.

IMHO temporal AA is, if properly implemented, not that bad in motion. Notice that our movie shows motion in every scene, and there is still a noticeable improvement in subpixel features rendering. I recommend downloading our demo to see the real thing. Temporal SSAA is not as robust as MSAA, but still does the job.

Our temporal reprojection approach, which is the same as Crysis 2, does not produce any visible ghosting (to my eyes) in playable framerates (>15fps); there is a section of our movie showing this. To achieve this, we're using velocity weighting to determine if a certain pixel was there in the previous frame. You can check out the details on Tiago Sousa's slides here: http://iryoku.com/aacourse/#talks

However, as others already said, if objects are moving too fast, temporal AA is less effective. However, we're less sensitive to aliasing when an object is moving fast, and motion blur deals with these scenarios pretty well. In the case of our technique, when objects are moving fast, MLAA and MSAA can still deal with aliasing.
 
Back
Top