Wednesday, October 19, 2011

Sampling Different Types of Anti Aliasing

Anyone who pays much attention to settings that can be forced in drivers or games has probably noticed by now that there's a whole lot of different types of Anti-Aliasing. The main two things people know about it though, are that it murders GPU and VRAM, and that it makes things look smoother. The method behind the madness, however, is generally regarded with the same apprehension usually reserved for Voodoo rituals.

In a recent post, I discussed the benefits of Anti-Aliasing and how they apply to the average gamer. That doesn't change the fact that there are a whole helluva heap of acronyms, and apparently some of them are easier than others, and they theoretically all do the same thing, in different ways, using different amounts of resources, and for some reason, we always refer to it in multiples, like x4, x8, and so on.

Just as a quick recap, Aliasing is what we call it when a line that isn't directly vertical or horizontal is depicted in pixels, and gets a little staircase effect. Anti-Aliasing is just there to make your eye think that isn't happening to things look pretty.

One of the earliest forms of AA in gaming was SuperSampling AA, or SSAA. It just happened to be a bit too brutal for the graphics cards of the day, and got phased out for a while, but is making a comeback now. Supersampling basically means rendering the scene at a higher resolution so that each pixel you'll see is composed of more pixels. These pixels then get blended based on various algorithms, which were either determined by throwing darts or by someone way smarter than me. There's also adaptive supersampling, which mostly seems to involve a combination of witchcraft and tarot to determine which pixels actually need to be full supersampled, which means your GPU takes longer to explode trying to do all that work.

FSAA, or Full Scene AntiAliasing, is just another name for Supersampling, since they needed something new to call it to not scare the pants off of people who watched SSAA turn games into slideshows back in the day.

MultiSampling AntiAliasing, or MSAA, one of the versions we see more often, is essentially a refinement of SSAA that uses less GPU horsepower by only sampling certain portions of textures and polygons, based on depth and location in the scene. The best I've managed to understand the specifics imply some sort of mathematical formla involving the cosine of the square root of negative infinity minus pi. Or some such nonsense. Basically, it isn't quite as pretty, does part of the same job, and beats less of the shit out of your graphics card. Got it? Good, now help me figure it out, it gets more confusing every time I try to understand it.

Of course, there's still one thing we haven't covered. Where the hell does the x4, x8, etc. come from? Well, roughly, that tells it how many "samples" you want rendered for pixels that it decides need samples rendered for. Then it promptly goes back to the roulette wheel to decide which pixels to make prettier, and hey presto, it automagically looks better!

I hope this has been either educational or entertaining, if not go back and re-read the parts that confused you, (paragraphs 1-7?) while I go take a tylenol.

2 comments:

  1. Thanks for this post!

    So I can assume that MSAA is the most common type of AA since I also find them in the settings from various game benchmarks.

    Would you say that the effect of the of the different type of AA is generally indistinguishable to one another, i.e. different types of AA will give roughly the same effect to the human eye?

    ReplyDelete
  2. Uhm, I wouldn't know what's most common, but since MSAA is a bit gentler on the GPU, it wouldn't surprise me.

    As far as how distinguishable they are, I would say that in real world application, maxing one versus the other, it would be pretty much impossible to differentiate them.

    Most likely, an expert could, with sufficient screenshots, tell them apart. But that would require a low pixel density display, expert knowledge of the algorithms and their specific effects, perfect display color (don't usually see this with low pixel density), and individual, identical frames to compare.

    ReplyDelete