Future of AA Techniques

Future of AA Techniques

Hopefully you all had a good time at Siggraph. For game programmers, the one course that you absolutely must check out is Filtering Approaches for Real-Time Anti-Aliasing. Make sure to check out the course webpage which will include slides and sample images. Here’s my general thoughts on it.

1. We don’t need perfection. And FXAA is pretty cool. When looking at AA approaches, 720p with no AA has very bad aliasing artifacts. It’s really bad, especially if you have long lines and lots of contrast. I remember talking with Alex Fry (from EA) who made the point that you get a huge gain going from 1x to 2x MSAA. When you go from 2x to 4x, it looks better, but by a smaller margin. When you are an average distance away from a real screen, 2x gets you about 80% of the way there and 4x gets you that last 20%. 4x rotated-grid MSAA on the 360 looks very good. You’ll still see some aliasing in the worst cases but artifacts will be very rare. Obviously, there are many considerations here that I’m glossing over (like deferred/light prepass rendering).

I have the same feeling about FXAA. Eric Haines (from the RealTimeRendering blog) wrote the article FXAA Rules, OK? Guess what his opinion is? Generally, I’d agree with Eric’s points. FXAA is not perfect. You don’t get ideal edge fixing. But when I look at it in real games, it seems “good enough”. There are so many reasons why games don’t look photoreal, such as lighting models, faceting, texture filtering/compression, shadows, you name it. And FXAA is good enough that I’d rather focus my development time and GPU time on something else. FXAA requires no extra memory, only one extra pass on the color buffer, is pretty fast, and is good enough. So I’m not really interested in a more expensive AA technique that requires extra passes but looks slightly better. Let’s say FXAA takes about 1.0ms of GPU time. Even if you have an algorithm that creates perfect AA in 4.0ms, I’d probably still take FXAA. For me, this result beats techniques that require multiple passes. Real levels in most games push the limit on tiny triangles so if you want to do any kind of extra pass or extra render target during your main/depth pass, you’re usually adding at least 1-2ms of time before you even get to the AA fixing part of your algorithm. I’d rather spend those GPU milliseconds fixing something else.

2. Perfect Detection is more important than Perfect Filtering Post AA has two separate problems: Edge Detection and Edge Fixing. With FXAA as your baseline, I’d rather do a better job detecting edges than do a better job fixing the edges. So an algorithm that is more expensive but gets cleaner edges doesn’t really interest me, but I’m definitely interested in paying for better edge detection.

3. On next gen, 1080p displays make “perfect” AA less important. I have no inside information on the next gen consoles, but I think it’s a fair bet that all games will be at 1080p. Wouldn’t bet on 60fps or 3D but you never know. With a 1080p display you have slightly smaller pixels. Aliasing is still a problem (you can clearly see aliasing artifacts, even at 1080p) but it will be less of an issue.

So once we get there, I don’t think we’ll get much real improvement from “Overkill” AA approaches. The standard for “Good enough” will actually go down.

4. Why the hell would you still use MSAA for any kind of deferred/light prepass renderer? 4x rotated grid MSAA is still the king if you have a one-pass forward renderer. Then again, how many games do that? Not many. During the God of War talk, I think Cedric and Tobias said that when you add it all up, you spend about 5ms on MSAA. The same was roughly true for Uncharted 2. For any renderer that is not completely forward some kind of Post AA seems like a big win.

Of course, when used the way that it’s meant to be used, 4x rotated grid MSAA is still awesome. If you could actually do 4x rotated grid MSAA with all your render passes for free, then I’d tell you to forget all this post AA nonsense and stick with MSAA. But given the cost Post AA seems like the clear winner.

5. Thank Alexander Reshetov for fixing our groupthink problem One of the stupidest arguments I ever hear is “you shouldn’t do that because no one else is doing it”. I distinctly remember a phone interview that I had several years ago. This was when I was between things and eventually landed at Naughty Dog. He asked me what I thought was important and I made the case for Filmic Tonemapping. The interviewer’s response was that I must be crazy because the consoles has been out for several years, best practices had been established, and there was no way Filmic Tonemapping could be worthwhile because no one else was doing it. Suffice it to say, I didn’t end up on that project.

So that’s what Alexander Reshetov at Intel fixed. Most graphics programmers have at some point thought about doing AA in post. I personally had a few failed attempts in college. But common wisdom was that it couldn’t work. When he publishing his MLAA paper he essentially slapped some sense into us. That paper was incredibly important, not because it found some incredible technical innovation that we all build upon, but because it brought attention to the issue. And two years later we have the Anti-Aliasing course with tons of options.

We should really keep this lesson in mind. Even when consoles are mature, we should always be on the lookout for new ways of doing things. Alexander deserves credit for pushing MLAA much in the same way that Crytek deserves credit for convincing us that SSAO would work. Today, I couldn’t imagine making a game without SSAO and some kind of Post AA, and neither of those techniques were on anyone’s rader for the first few years of the current console cycle. That’s what innovation is: doing things that no one else is doing.

comments powered by Disqus