I've been meaning to write about antialiasing for a while, but now I sit down to do that I realize I have too much to say for a single article. So this post is the introduction to a series.
Antialiasing is one of the most important yet least widely understood areas of computer graphics. If I had a penny for every time I heard the developer of a 2D game say "I turned on antialiasing but my sprites still look jaggy", well, I'd be up to six or even seven pennies by now!
The thing is, "antialiasing" is really too vague a term to mean anything at all! The important word is "aliasing", which is surprisingly hard to pin down. Dictionary.com gives two definitions:
- Jagged distortions in curves and diagonal lines in computer graphics caused by limited or diminished screen resolution.
- Distortion in a reproduced sound wave caused by a low sampling rate during the recording of the sound signal as digital information.
Artifacts created when a source value (which can be either analog or digital) is replaced by a digital approximation.
- We approximate the shape of arbitrary objects as a list of triangles
- We approximate the shape of a triangle as a grid of dots (screen pixels)
- We approximate arbitrary images as grids of dots (textures)
- We frequently approximate one grid of dots as another different grid of dots (scaling images, rotating, or mapping them onto 3D geometry)
- Our shader programs use many digital approximations, as varied as the things for which we use shaders (ie. basically infinite)
- We approximate moving objects as a series of static images (animation)
Ok, that was kinda dry. Next up, more theory. Then after that, some practical examples.