Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Antialiasing algorithm?

I have textures that i'm creating and would like to antialias them. I have access to each pixel's color, given this how could I antialias the entire texture?

Thanks

like image 349
jmasterx Avatar asked Jun 10 '10 02:06

jmasterx


People also ask

What is anti-aliasing algorithm?

Anti-aliasing is a method by which you can eliminate jaggies that appear in objects in PC games. There are several different types of anti-aliasing methods, each with its own pros and cons. Most PC games have an in-game window where you're able to adjust graphics settings, including anti-aliasing.

How is anti-aliasing achieved?

In Render mode, Anti-aliasing is achieved by redrawing the rendered scene a specified number of times, each time jittering the image by a small amount, so that in the hard edges are softened by displaying slightly lighter pixels adjacent to the dark ones.

What anti-aliasing method should I use?

The best anti-aliasing method can be difficult to choose, and it generally depends on your machine. If you have a top-notch, high-end computer, then SSAA is the best solution. If your PC is mid-range, you will probably have the most FPS with FXAA.

How does an anti aliasing filter work?

An anti-aliasing filter looks at the user-specified sampling frequency and removes any under-sampled frequencies that may appear in the signal (i.e. signal component frequencies >0.5 of the sampling frequency).


1 Answers

I'm sorry but true anti-aliasing does not consist in getting the average color from the neighbours as commented above. This will undoubtfully soften the edges but it's not anti-aliasing but blurring. True anti-aliasing just cannot be done properly on a bitmap, since it has to be calculated at drawing time to tell which pixels and/or edges must be "softened" and which ones must not. For instance: imagine you draw an horizontal line which must be exactly 1 pixel thick (say "high") and must be placed exactly on an integer screen row coordinate. Obviously, you'll want it unsoftened, and proper anti-aliasing algorithm will do it, drawing your line as a perfect row of solid pixels surrounded by perfect background-coloured pixels, with no tone blending at all. But if you take this same line once it's been drawn (i.e. bitmap) and apply the average method, you'll get blurring above and below the line, resulting a 3 pixels thick horizontal line, which is not the goal. Of course, everything could be achieved through the right coding but from a very different and much more complex approach.

like image 57
Nick Drake Avatar answered Sep 20 '22 06:09

Nick Drake