Anti-Aliasing

posted May 16, 2024 by Robert Bobocea

On your computer there are millions of pixels. In fact you are using those millions of pixels right now to read this blog post. To make a straight line on a computer screen on the vertical and horizontal axis is easy. All it is is a line of pixels in one direction. When diagonals get introduced that is when it starts getting complicated. If you were to upscale and zoom in on how your computer displays a diagonal line it would look like this. 

As you can see from far away that line looks slightly jagged but the more you zoom in the bigger those “steps” get. Those jagged edges can be smoothed out by adding gray pixels around it. The reason more pixels can’t be added is because the pixels to create the jagged line happens because smaller pixels can’t be added. The reason gray pixels are added is because it is the mixture between the whitish background and the black line. There is a setting created to help with the jagged lines and this setting is called anti-aliasing. Anti-aliasing is a software setting that is designed to make lines look “smoother.” This setting is a common setting that is used in games and other applications. In the picture above you can observe this by the line has a more gradual decline. 

Anti-aliasing has 4 sub-settings. The names of these settings are temporal anti-aliasing (TAA), super sampling anti-aliasing (SSAA), multisample anti-aliasing (MSAA), and adaptive anti-aliasing (FXAA). SSAA is the most accessible form of anti-aliasing. It works by taking a higher-resolution image and downsampling every pixel. It also averages the color everywhere to erase the jagged edges or lines everywhere in the picture. TAA is a type of anti-aliasing that samples each pixel and uses previous frames to make those jagged edges disappear. This can have its downsides because previous frames can appear and mix with the frames on your screen at the moment. This is called ghosting because there are blurs and the previous frames that should have “died” are still showing. FXAA deals with cleaning up the jagged lines instead of dealing with the rendering . FXXA is less demanding than MSAA and SSAA, but is not as effective as them. MSAA, is a not as demanding form of SSAA. Instead of going through the painstaking process of sampling every pixel, MSAA only comes into play where aliasing could become an issue (an edge), which saves a lot of computing resources. This setting is a vital setting to improve and give your game a realistic look.

This is how no AA looks like

This is how FXAA looks like

This is how MSAA x2 looks like

This is how MSAA x4 looks like

This is how TXAA looks like

This is the original picture that was zoomed in onto the S.