• Hey Guest. Check out your NeoGAF Wrapped 2025 results here!

Everything you ever wanted to know about aliasing (article)

Stochastic sampling is best when you get to high sample counts, but at the levels usually employed in real time graphics (e.g. 4 samples), a "regular" sparse grid often looks better in my experience.

It's an interesting article... but it's dense. Almost unreadably dense. I understood the principles of AA going into the article and I still had to reread several parts over a few times for it to really sink in. Maybe I'm just tired...
No, you are probably right. The story of this article is actually that I initially wrote it with the intent to put it on digital foundry, but it was too technical for that. But since that's what I wanted it to be (a reference and not just a look at AA in games) I contacted B3D.
 
Well I reread the article last night and armed with a whole host of information set to the task of experiment and I'm shocked how effective having a information on how a certain method is going to be applied before you start flipping switches produces the results you expect. Though I tried implementing your ground truth method and oh my god my poor frame rate. I dialled it back to 4xSGSSAA with 2x2OGSSAA which was a more palatable experience but it seams like overkill performance wise. That and in some cases you can see the benefits and the drawbacks of each method and sometimes both at the same time. I think you might just start a slight new trend here or at least a tangent of one.

No, you are probably right. The story of this article is actually that I initially wrote it with the intent to put it on digital foundry, but it was too technical for that. But since that's what I wanted it to be (a reference and not just a look at AA in games) I contacted B3D.

I don't know. Yes it did require me to slowly read through to understand the concepts and how each method is implemented but the slides you provided were a great help. Though I do feel this is a very, very broad topic that isn't easy to sum up in short article although you've done a great job of conveying the information.

My basic understanding of how anti-aliasing is implemented in 2d comes from college and the algorithms used within Photoshop and variances in luminance levels across RGB channels and looking of conflicting patterns but your article goes above that and sometimes away from. Though in my thirst for knowledge I did read the paper you linked to SMAA and that was a massive eye opener. Really getting to the root of how MLAA works and how SMAA can not only be more accurate but more efficient. The section on edge detection for each really showed how different they are especially the way each function.

I did follow your link to Nvidia's TXAA page but asides from having read it before it's a bit thin. I did find a few older articles and forum posts by Timothy Lottes on the subject. They were cut from older blog posts of his which no longer exist but they did explain the fundamentals and how using TXAA with OGSSAA is different than using SGSSAA but both can give a desired result. Sadly they did link to videos which are no longer to be found which judging by the responses really show TXAA in effect.

I would overwhelm you with a raft of questions but as I have found there is loads of information out there so I'll just ask 2.

Are you planning on doing any further articles on aliasing in the future? I found this a great primer but there's massive of scope to go into each method.

And who do I go to at Beyond and give the thumbs up and say I want to see more of this?

Thanks again.
 
Cool article, seemed to be fairly comprehensive and I liked the background on where the term came from.

I noticed a slight error on this page; http://www.beyond3d.com/content/articles/122/3

In Figure 3 one of the interactive examples is titled "8x8 grid with perfectly antialiased triangle" but this seems to be an error as this figure is not about a triangle nor is this example.

Very minor error though.
 
Durante I'm upset you didn't include the "sit back further from the tv" AA method.

Otherwise it's a great write up and the comparison tools are really well done.
 
I'm definitely going to read through this, because as of now I just click each one and compare the differences without knowing anything about any of them.
 
Can't say I got all of that, but I honestly never even thought of what the 2x, 4x, 8x meant when selecting AA options and now I know, so thanks for that
 
Are you planning on doing any further articles on aliasing in the future? I found this a great primer but there's massive of scope to go into each method.
I would love to do an article that goes in detail about the performance impact of each of these AA options -- something I don't really cover at all -- in various scenarios and on various hardware, but I simply don't have the time (and neither the large number of GPUs required) to thoroughly analyze this. And I certainly don't want to do a half-baked article.

And who do I go to at Beyond and give the thumbs up and say I want to see more of this?
I guess you can register and post in the article comments. AFAIK B3D isn't really a huge "commercial" thing like some other sites. They post articles that meet some quality standard and fit the site profile, but they don't really produce them on demand. Personally, I've been reading B3D since 2000 (or earlier) and been a forum member since 2002. It was the place for real technical in-depth information during the glory days of 3D hardware acceleration, when each generation of cards every year brought entirely new features to the table, not just better performance. I never expected 12 years ago to ever see an article I wrote on B3D, it's a really nice feeling.

short AA demos (SMAA T2X) -10MB per video.
Those are really nice.
 
I can't wait to dive into this article. I've spent waaaayyy too much time experimenting with different types of AA with inconclusive results.

As always, Durante is awesome. All hail Durante.
 
Durante, you're a savior. Just wanted to get that out of my chest. Your mod for Dark Souls is something else.
 
Thanks for this great article. Now I understand a lot more than before even though I'm kinda overwhelmed :)

Stochastic Sampling and those linked geometrical approaches look and sound best. I hope they will be used more often in the future now.

short AA demos (SMAA T2X) -10MB per video.
And thanks for those videos as well. Now my eyes hurt from this massiv aliasing :D They do show the current problems quite well though.
 
That was a nice read. Thanks, Durante.

Also thanks for that mention of the stochastic SS, ScepticMatt. Interesting stuff.


Also, sign me up for team groundtruth as well. Heh.
 
Those are really nice.
Source including ... source.

Stochastic sampling is best when you get to high sample counts, but at the levels usually employed in real time graphics (e.g. 4 samples), a "regular" sparse grid often looks better in my experience.
I've looked for more comparisons, but the best I found is from the original SIGGRAPH paper (1985):
stochasticsamplingbjxod.png

top: no supersampling
bot: 2x supersampling
left: no jitter, middle: 50% jitter, right: full jitter


Normalization filters to reduce noise:
capture2ejsff.png

top: no supersampling
bot: 2x supersampling
left: no filter, right: filter

so I'd say with supersampling and reduced jitter amplitudes and normalization filters, it thought it might already prove noiseless enough. But you're probably more of an expert on that matter.
 
Great article. If I'm looking at it right, 4xSGSSAA is the best overall method with the least FPS drop. In fact its performance hit is better than 4xMSAA...interesting. Is SGSSAA a commonly used method?

Also, typo on page 13. 'artefacts'. :P
 
Very great article. I really do hope more games start implementing SMAA techniques of some sort. Te combined temporal, sample, and analytical are all wonderful. Hence how Crysis 3 looks so... clean edged usually.
 
Great article. If I'm looking at it right, 4xSGSSAA is the best overall method with the least FPS drop. In fact its performance hit is better than 4xMSAA...interesting. Is SGSSAA a commonly used method?
No, SSAA is generally much more expensive than MSAA at the same sample count (regardless of sample pattern). Its advantage is that it deals with shader aliasing, texture aliasing and transparency aliasing, while MSAA only deals with geometry aliasing.

Also, typo on page 13. 'artefacts'. :P
Good catch.
 
Hey Durante.

Program does not start and complains about missing MSVCP110.dll.
I installed the c++ redist. but still the same.

Win7 64bit
 
Does anyone know of any list of games which implement some of the more recent, higher quality combined sampling/analytical AA methods? (That is, higher SMAA levels or TXAA)
 

No worriers. I can imagine this article took a fair amount of blood, sweat and tears. Going in to more detail would could end up being a life'a work and as you say a good selection of hardware would be needed. Just as long as you're willing to educate us folk hear from time to time ;)

I can remember looking at B3D a few years ago and a lot of stuff went over my head. Though it make a lot more sense to me now a days.

Does anyone know of any list of games which implement some of the more recent, higher quality combined sampling/analytical AA methods? (That is, higher SMAA levels or TXAA)

Nvidia list TXAA support for these:

The Secret World
Assassin's Creed III
CoD: Black Ops II
Neverwinter
Splinter Cell: Blacklist
Batman: Arkham Origins
Assassin's Creed IV: Black Flag

and I'm sure I've seen it advertised in CoD: Ghosts and I think I've seen it pop up in maybe a few other titles not listed before.
 
Does anyone know of any list of games which implement some of the more recent, higher quality combined sampling/analytical AA methods? (That is, higher SMAA levels or TXAA)

Crysis 3 has FXAA, SMAA 1x, SMAA T2x, SMAA 4x, TXAA 2x, TXAA 4x, MSAA 2-8x.
 
Yeah, I know about Crysis 3, IIRC someone from Crytek was actually involved with SMAA development. Are there any other games which include SMAA4x?

Arma 3 has few SMAA options, but i think those are only SMAA 1x quality ones, not actual different implementation of SMAA ;\

And yeah Tiago Sousa from Crytek was co-developing SMAA.
 
And perhaps a good deal more than that.

Diving into Anti-aliasing is an article I wrote not in a small part because of various GAF posts over the years which I wrote trying to explain the various types of aliasing, anti-aliasing, and their various advantages and drawbacks. I always felt those were insufficient, but still too long and meandering (and not illustrated well enough) to actually cover the topic. And there wasn't really a single, complete and modern resource on the internet which explained all types of techniques and put them into context.

What I ended up with is that article and an accompanying demonstration program which hopefully helps everyone (who wants to) in understanding all the issues and attempted solutions.

If you ever asked yourself "why is SGSSAA (if available) better than downsampling?" or "why does SMAA sometimes look better than 4xMSAA and sometimes look worse?" or "what is up with that chain link fence / specular highlight when everything else is perfectly anti-aliased?" then you should read this article.

Also, sorry for continuing to make people not take gaming seriously ;)

(Edit: I just realized this might be considered as self-promotion, so I'd like to note I get absolutely nothing -- well, except happiness ;) -- from people reading this article)

Awesome, awesome read :)!
 
How do various quality settings of SMAA correspond to the number of samples taken? (Low, normal, high, ulra, etc.) Is that a separate parameter?
 
How do various quality settings of SMAA correspond to the number of samples taken? (Low, normal, high, ulra, etc.) Is that a separate parameter?
It's a rather complicated topic.

Most of the time when you get the opportunity to use "SMAA" (either native in games or by injection) it will be SMAA1x. That in itself has different quality settings, but always only takes one sample (it's a pure post-processing method). The other SMAA types are usually not just called "SMAA" but more specifically e.g. SMAA4x. These use multiple temporal and/or spatial samples. For example, SMAA S2x uses two spatial samples.

The problem is that you cannot (easily) inject anything other than SMAA1x, since the other methods require more in-depth changes to the rendering pipeline.
 
It's a rather complicated topic.

Most of the time when you get the opportunity to use "SMAA" (either native in games or by injection) it will be SMAA1x. That in itself has different quality settings, but always only takes one sample (it's a pure post-processing method). The other SMAA types are usually not just called "SMAA" but more specifically e.g. SMAA4x. These use multiple temporal and/or spatial samples. For example, SMAA S2x uses two spatial samples.

The problem is that you cannot (easily) inject anything other than SMAA1x, since the other methods require more in-depth changes to the rendering pipeline.

Damn, that makes it sound like we're really missing out. The 4x SMAA examples were really impressive, far beyond what I thought you could achieve without MSAA/SSAA.
 
Damn, that makes it sound like we're really missing out. The 4x SMAA examples were really impressive, far beyond what I thought you could achieve without MSAA/SSAA.
Well, they aren't achieved without MSAA/SSAA ;)

SMAA 4x uses 2 spatial samples over 2 timesteps for 4 total samples. So it needs 2xMSAA + sub-pixel offset over even/odd timesteps + postprocessing to make it all work together.

But yes, the performance/quality ration for it is really good, and if all game developers cared as much about IQ as Crytek or me you could use it in every game :P
 
It's a shame that the popularity of deferred rendering has limited our options so much in the last few years. I assume that the 4x SMAA you just described would be ruled out for the same reason as traditional MSAA? Also, is there any hope that Forward+ rendering will save us?
 
DURANTE.

I sense LIES in your article!

I was looking at your sampling AA comparison page, and I noticed something rather peculiar. The box looked significantly jaggier in the 8xMSAA image than in the 8xSGSSAA image. This struck me as odd, since MSAA typically uses the same sorts of sparse sample patterns that SGSSAA does. I would have expected purely geometric detail like the box edges to look roughly the same between the two images. It all seemed especially odd considering that the text had this to say on the matter:

Features of note include the equivalent quality of SGMSAA and SGSSAA with the same sample count for geometry aliasing

Anyway, I took a close look at the box. The 8xMSAA image seemed legit, about 8 horizontal steps per vertical pixel jump. But when I tried to determine how many samples were used in the 8xSGSSAA image, I couldn't, because the shade changed with every single pixel horizontally. Then, I looked at the "ground truth" image, and... it looked exactly the same as the 8xSGSSAA.

8xMSAA on the left, 8xSGSSAA in the middle, "ground truth" on the right.

3BMle7V.png


:)

//=========================

On a semi-side note, it looks like objects in the "ground truth" image have a bit of ringing where they make contact with the blue background. Is that intentional?
 
Hmm, could be a mixup of the images. The problem is that the current version of the program is quite different (I actually rebuilt it from scratch for the public release), so I can't easily replace it with a correct one.

It's a shame that the popularity of deferred rendering has limited our options so much in the last few years. I assume that the 4x SMAA you just described would be ruled out for the same reason as traditional MSAA? Also, is there any hope that Forward+ rendering will save us?
It's not ruled out at all, never was really, it just requires people to think about it and implement the resolve at the correct step during their rendering process. And it requires more performance -- more than anyone is willing to spend on consoles. And that's why only Crytek does it :P
 
Well, they aren't achieved without MSAA/SSAA ;)

SMAA 4x uses 2 spatial samples over 2 timesteps for 4 total samples. So it needs 2xMSAA + sub-pixel offset over even/odd timesteps + postprocessing to make it all work together.

But yes, the performance/quality ration for it is really good, and if all game developers cared as much about IQ as Crytek or me you could use it in every game :P

Thats why we need to force all developers to switch to CryEngine, because it has all those AA modes implemented by default :P

Btw if You want to test SMAA 4x and TXAA more in CryEngine, SDK has all of them and AA zoom debug mode :)
 
Thank you Durante, I will read the article as soon as I'm back :) I'm about to head out but in the fear of making a fool out of myself, let me still ask this question before I go: As far as I know the inherit problem why aliasing even exists is the use of square-pixels on the screen so I'm wondering, is there any reason (I'm guessing cost and manufacturing processes?) why we still to this day rely on square-pixels to show images on a screen?
 
Just started reading, will post questions if I have any.
Thanks for the article, Durante!

On the subject of sample positions:
Rotating the grid only trades bad vertical/horizontal alising for bad aliasing at that rotated angle.

Due to the distributions of the rods and cones in our eyes, they are very good to detect patterns, but bad at high frequency detail[1]
receptors58udm.png

I read the pdf you linked, but still not sure how to interpret the above image of the distribution of optical receptors on the retina. If the right image (b) is supposed to be a Fourier transform of the left (a), why is the result a radial pattern? Am I supposed to interpret it as multiple (phase-shifted) instances of each frequency, at varying amplitudes?

edit: did some reading, I get it now. If there's anyone else who's familiar with time frequency analysis rather than spatial frequency analysis, these are some helpful links:
http://spie.org/x34301.xml
http://xrt.wikidot.com/blog:28
 
Thank you Durante, I will read the article as soon as I'm back :) I'm about to head out but in the fear of making a fool out of myself, let me still ask this question before I go: As far as I know the inherit problem why aliasing even exists is the use of square-pixels on the screen so I'm wondering, is there any reason (I'm guessing cost and manufacturing processes?) why we still to this day rely on square-pixels to show images on a screen?
Well, other shapes of pixels wouldn't really solve the issue, at best they'd just move it to a different direction. There are some screens with different pixel/sub-pixel alignements (e.g. Pentile OLEDs), but with those you can even get some artifacts on perfectly straight vertical or horizontal black/white lines. Since those are pretty important square axis-aligned pixels make the most sense.
 
Top Bottom