What is anti-aliasing in games or comfortable image technology? A quick overview of anti-aliasing in games

The time has already passed when games impressed solely with their gameplay: the player long ago became demanding and, in particular, demanding of the quality of the picture presented on the screen. However, few people know that today many game developers use FXAA anti-aliasing to ensure a high degree of quality. What this is is not known to all gamers today, so many people wonder whether it’s worth turning on this function at all.

The vast majority of players are well aware of what the so-called ladders along the edges of objects are, as well as how this problem can be solved by using “anti-aliansing” or simply “smoothing”.

What is smoothing?

Anti-aliasing is a good thing, since it significantly increases the perception of the picture, and in modern realities, those games in which it is not used most often end up booed. However, the way FXAA anti-aliasing is implemented remains unsatisfactory. What it is, many users may not even be interested, but in fact, it is the implementation that affects the quality of the final picture.

Poor implementation often results in the target hardware having insufficient processing power. Of course, those people who prefer to play on a PC find themselves in favorable conditions here, since in this case the power of the equipment directly depends on the material capabilities of its owner, however, console players are most often satisfied with the gameplay, since the quality of graphics in the vast majority of cases on computers is much higher. better compared to what graphics console games have. However, each person independently chooses where and what to play.

What is FXAA?

It’s immediately worth noting that game makers have been using FXAA anti-aliasing technology for quite some time. They didn’t know what it was then, but its first use was found in the MMO Age of Conan, as well as in the world-famous shooter F.E.A.R. In these games, however, only the original version of this anti-aliasing was used, which at that time was not the most productive solution.

Nowadays, games use a slightly different FXAA format. such as Fast approximate Anti-Aliasing, which is a more effective solution compared to traditional MSAA technology. This is a one-pass pixel shader, with the help of which the resulting frame is calculated at the post-processing stage. This shader was created as a faster solution that is less demanding on memory compared to the above, but the technology pays for its advantages in accuracy and quality. Seeing this, many may feel that the technology is irrelevant. In fact, this is not entirely true.

What are the advantages of this method?

FXAA anti-aliasing has a number of benefits, including improved anti-aliasing of so-called subpixels and speculars. In the official document, the developer of this technology, Timothy Lotts, says that his product, with medium quality settings, post-processes frames with a resolution of 1920x1200 on a base at a speed of less than one millisecond.

The main advantages that FXAA anti-aliasing has are that it uses a sub-pixel anti-aliasing algorithm that works more efficiently than the MLAA algorithm, which is quite sufficient for the operation of equipment that operates at the DirectX9 level. That is, in this case, post-processing is carried out in one pass, and the most interesting thing is the complete independence of which GPU Compute API is used. However, there is one drawback here - developers must necessarily integrate this technology into various games. At the same time, traditional anti-aliasing technologies work or, conversely, cannot work at the driver level. Thus, as long as programmers use the exponential smoothing method in their engines and do not use FXAA code in their engines, it will be impossible to achieve the desired effect, since it was impossible to include code from outside until recently.

How was the problem resolved?

Over time, it was decided to initially introduce the FXAA code into the d3d.dl library, as a result of which it became possible to flexibly customize the result through various configuration files, as well as enable or disable FXAA using the button. This set of files is initially copied to the directory where the DX9 application executable file is present, and this application, when launched, will pick up the library containing the required code. At the same time, since the developer of the technology for introducing this code into the library initially made sure that the results of the work were placed in the log, users actively began to identify bugs in the operation of this technology, which were quickly corrected. Over time, “injections” with code for DirectX 10 and 11 formats also appeared.

How to check?

The most obvious way to determine the effect of using the exponential anti-aliasing method and FXAA is in the game World of Tanks.

If FXAA is not used, obvious "escalators" begin to appear, and despite the fact that tank models can be quite large and will also have decent detail, the artifacts appear very noticeably, and this is especially true for various thin objects. The built-in anti-aliasing technology tries to blur the edges of objects in some way, but it does it rather mediocrely, not to mention the fact that the picture can be blurry in places.

What are the changes?

After the FXAA tool is turned on, the result becomes clear: the artifacts completely disappear, but some blurriness of the picture appears. Apart from this, there is also a unique FXAA Sharpen variant. The developer of the technology in one of the versions added a sharpening filter, which was taken from MPC-HC, and the end result turned out to be quite decent: blurriness completely disappears, textures get an even sharper look compared to the original, and “ladders”, despite the use of this filters are almost completely absent. Now you know what FXAA is in games like World of Tanks. Due to the fact that the authors initially did not plan such a sharpness of the texture, the towers could “knock out” a little, but in the gameplay this is almost unnoticeable.

Performance here remains virtually unchanged. Of course, the World of Tanks engine works in a somewhat surprising way, so performance spikes or drops can end up appearing out of nowhere.

NoAA, SMAA or FXAA

If we compare the “noAA” or SMAA and “FXAA Sharpen” modes, the picture changes significantly for the better in the latter case. The only exception here is the sharpening filter used, which narrows excessively thin lines even further, in particular this is especially noticeable in the mounted artillery sight. Moreover, the number of frames per second in the FXAA version is significantly higher than the previous version.

During long-term tests, it was determined that when using FXAA, performance drops by approximately 10-12%, while when using the MSAA 4x anti-aliasing method, the quality of which currently competes with FXAA technology, there is a complete drop in performance by 50% or more.

Update

In 2011, a customized version of the injection also appeared, which included all of the above FXAA options and their benefits. This assembly contained a fairly large number of filters, among which it is worth highlighting:

  • Blur.
  • Vignetting.
  • Color saturation.
  • Sepia.
  • And many others.

All this is quite simply configured through one file, and the most useful thing in this case: the settings can be easily changed even during the game, you just need to minimize the application, open the settings editor, expand the application and enjoy the new settings without having to restart the application you are interested in. Thus, it was possible to completely eliminate fading after activating the sharpening filter, providing a clearer picture in which there are no “ladders” of blur and high quality textures have been achieved.

Hello.

Gone are the days when video games brought a whirlwind of emotions simply because we played them; The player has long become demanding, and not least - regarding the quality of the picture on the screen. I want to talk about one of the components of this quality - smoothing.

The vast majority of players know about “ladders” on the edges of objects and a possible solution to this problem - “anti-aliasing”, or “smoothing”. This issue is described in great detail in the article by Don Woligroski Anti-Aliasing Analysis, Part 1: Settings And Surprises (Russian translation). Also, a good comparison with examples of games of the current generation of game consoles is from Digital Foundry - The Anti-Aliasing Effect (English). In short, it all comes down to one thing: anti-aliasing is great, image perception is greatly increasing in price, in the modern realities of the gaming industry, products with little anti-aliasing or even without it are in the category of booed (primarily by fans of competing platforms, but still) , but the implementation of high-quality anti-aliasing leaves much to be desired, mainly due to the insufficient computing power of the target equipment. In this case, of course, apologists for playing on a PC find themselves in much more favorable conditions, because the power of their hardware is influenced only by the material factor, but console players do not miss the opportunity to mock PC players about “PC HAZ NO GAEMZ!”, they say, you don’t have games, you play with graphics. I will not deliberately touch on this issue, because in principle there cannot be rational and objective arguments in favor of the subjective feeling of “warm tube gaming”; this is a matter of personal choice with all that it implies. Already existing and used algorithms are described in the above links, so I’ll go directly to the topic: what is FXAA, what is it eaten with and how tasty it is.

Let's start with the theory. To be very precise, FXAA is not such a new algorithm: it was first used in the MMORPG Age of Conan and has already appeared in the shooter F.3.A.R., but I will consider it as new, thanks to an interesting solution that I came across to your eyes on a frequently visited forum (thanks h0w1er). FXAA - F ast appro X imate A nti- A liasing is a more productive solution compared to traditional MSAA (Multi-Sampling Anti-Aliasing). This is a one-pass pixel shader that calculates the resulting frame in post-processing. It is designed to be faster and less demanding on memory compared to MSAA, “paying” for its “pluses” with accuracy and quality, although in reality everything is not as scary as it sounds. FXAA also has a number of advantages, including improved anti-aliasing of specular and subpixels (we are talking about surfaces smaller than one pixel, “ladders” make such objects flicker). In the whitepaper (PDF), FXAA creator Timothy Lottes states that for FXAA at medium quality settings (the "sweet spot" between quality and performance), post-processing a 1920x1200 frame on the GTX 480 takes less than a millisecond. The main advantages of FXAA, according to Timothy, are the FXAA subpixel anti-aliasing algorithm, which works better than that in MLAA, the sufficiency of DX9-level hardware for operation, post-processing of a frame in one pass and, in my opinion, the most interesting thing is independence from the GPU Compute API used. But there is one unpleasant thing - the need for developers to build this anti-aliasing technology into their games, when traditional anti-aliasing methods work (or do not work) at the driver level. In other words, until programmers use FXAA code for anti-aliasing in their engines, we will not get the desired effect; it was officially impossible to enable FXAA from the outside. Until recently.

And now - dance practice. You will practice on World of Tank, version 0.6.6.

The option without anti-aliasing (No AA) shows obvious “escalators”, and although the tank models are quite large and detailed, the artifacts are clearly visible, especially on thin objects, which will be discussed further below.

The built-in anti-aliasing option (Edge AA) tries to blur the edges of objects, but it does it rather mediocrely, not to mention the image looks a little blurry.

The next option is FXAA, the result is obvious: there are no artifacts at the edges, however, there is also a little more soapiness compared to noAA, although with EdgeAA the difference is almost imperceptible.

Well, the FXAA Sharpen option. Gast in version beta 6 I added a sharpening filter taken from , and the result is very decent: the soap disappeared, the textures began to look even sharper than in the original, and despite this filter, practically no “ladder” was added. Due to the sharpness of the tower’s texture, which was not planned by the authors, the texture of the tower was slightly “knocked out” (blue zone), but in the game, I can assure you, this is absolutely unnoticeable.

What about performance? Yes, practically nothing bad. Unfortunately, the WoT engine lives in its own world and performance spikes/drops can pop up out of the blue. I got the following:

The picture “In battle no AA” is what I talked about above: thin trees are crackling from artifacts, while in the version “In battle FXAA Sharpen” the pictures are much more pleasing to the eye, with the exception of the problems of the sharpening filter, which narrows too thin lines in the thickness of a hair, such as a mounted artillery sight. And the number of frames per second in the FXAA version is even higher, despite the fact that these two screenshots were taken 1 second apart and the tank was motionless.

In fact, during a long-term test, a figure of ~10-12% was obtained - this is how much performance drops when using FXAA, while MSAA 4x, with the anti-aliasing quality of which FXAA competes, quite often gives a drop twice as large. If comparisons are interesting, more numbers and pictures can be found in the article NVIDIA's New FXAA Antialiasing Technology on the [H]ard|OCP website, where I gleaned some of the information, and at the end of my short review I agree with Mark Warner @ HardOCP: with proper implementation FXAA has a great future, especially on consoles, where resources are strictly limited, and having the ability to customize the injection configuration to your liking, many will now be able to enjoy beautiful pictures in their favorite game without the help of developers.

UPD. On August 10, a more customizable injection, so to speak, a “hodgepodge” from the discussion participants, had already appeared.

Many smoothing methods have been invented. Over the course of a long time, they have been modified and improved. And after many years, so many of them have accumulated that it is not always clear to the user and confuses him when choosing settings in games and applications. In this article we will try to describe the most famous ones, which are divided into two types:

  1. when used at the time of formation and construction of the scene.
  2. when a filter is used on a finished image (post-processing).

Moreover, you can use both methods at the same time. Which one to choose based on aesthetic considerations and video card resources is, of course, an individual decision.


Let's start with the fact that AA ( Anti-Aliasing, Antialiasing) - a way to eliminate “stepping” at the edges of objects, lines that are inclined and are neither strictly vertical nor strictly horizontal. The “ladder” is especially noticeable at the junctions of polygons with different colors.
It can be used in games when the video card does not have enough power to display images in high resolution, where all the details are smooth and pleasing to the eye. If AntiAliasing works well and efficiently, then because of this, performance suffers and FPS in games drops. If it smoothes poorly, then the graphics suffer, blurring of the picture and artifacts appear. Therefore, if it is possible to play at a high resolution and the FPS does not drop much, do not enable AA, play at a high one. Another feature is that ladder anti-aliasing can be enabled at the video card settings level and also at the application level. The effect is “intensified” if the first and second types of smoothing are used. Therefore, if you are going to test anti-aliasing, make sure that it is turned on somewhere in one place, so as not to get blurry.

First type

The impact on FPS is direct, depending on the method and video memory bandwidth.

SSAA (SuperSample Anti-Aliasing , Oversampling smoothing) - The heaviest, but also the highest quality and terribly loading the video card. Accelerators use a regular mask ranging in size from 2x1 to 4x4. This is where the load appears, with a resolution of 1920x1440 and a 2x2 mask, a frame with a resolution of 3840x2880 is built (which requires 4 times more memory), after that, the colors of all sub-pixels in the mask are averaged and after that the frame is compressed and sent to the screen for output in original resolution.
The technology existed mostly before DirectX 8, until MSAA came along. Due to the large impact on FPS, it was abandoned. But since the power of video cards was constantly growing, NVIDIA returned it to service and is used for games with support for DX9, DX10, DX11.
Do you want 60 fps? Then you can figure out what load the video adapter will work under. However, you will enjoy the picture. This method is recommended for owners of high-performance video cards for modern games.

MSAA (MultiSample Anti-Aliasing ,Multiple sampling smoothing) - replaced SSAA, consuming fewer resources, but the result is slightly different. The image is still rendered at a higher resolution, but the performance is achieved by AAing only the edges of the object, rather than the entire image as in SSAA. On the downside, this method does not work on transparent polygons (glass, water...), so sometimes you can see a ladder. And since only part of the image is smoothed, artifacts can also be observed. Plus incompatibility with the delayed lighting method. You need to remember that MSAA is more profitable to use at low resolutions. The higher it is, the more expensive it is in terms of resources. It is also recommended for owners of top-end video cards with a lot of video memory.

CSAA (Coverage Sampling Anti-Aliasing , Smoothing sampling with overlap)
- this is a continuation of the evolution of SSAA->MSAA->CSAA, which has retained compatibility with the algorithms used in hardware. The improvement is achieved due to the fact that additional information about the subsample from the neighboring pixel is transferred to the frame buffer. Which ultimately helps to calculate better anti-aliasing.
At equal levels (4.8..) CSAA and MSAA, the frame quality will always be higher with CSAA, and in terms of performance they will not be inferior to each other.

In other words:
SSAA- smoothes the entire scene
MSAA- smoothing occurs only at the edges of objects
CSAA- by adding overlap samples, object edges are smoothed taking into account neighboring pixels. Those. here the emphasis is on frame quality, at almost the same level of load on the video card as with MSAA.

FSAA (Full Scene Anti-Aliasing) - Same as SSAA, but from AMD and with minor differences.

QCSAA (Quality Coverage Sampling Anti-Aliasing,Overlap Smoothing Sampling) - it’s not hard to guess that this is an improved version of CSAA, only it uses twice as many samples for analysis

EQAA (Enhanced Quality Anti-Aliasing, High quality anti-aliasing) - NVidia has CSAA, AMD has EQAA. They differ in the positions of the samples and, depending on the mode, in their number.

AAA (Adaptive Anti-Aliasing) - As you know, MSAA has a problem when smoothing edges on transparent objects. This method is designed to eliminate such a problem. It is a synergy of multisampling (MSAA) and supersampling (SSAA). As you might guess, this type is resource-intensive and is recommended for owners of top cards. Used by AMD.

TrAA (Transparency Anti-Aliasing, Transparent anti-aliasing) - same as AAA, only from NVIDIA.

TrAAA ( Transparency Adaptive Anti-Aliasing , Adaptive Transparent Antialiasing) - see TrAA

TrMSAA (Transparency Multi-Sampling Anti-Aliasing) - uses edge method (MSAA) for transparent objects. A variety of TAAA. May be referred to as TMAA

TrSSAA (Transparency Super-Sampling Anti-Aliasing) -
Uses full screen anti-aliasing (SSAA) for transparent objects. A variety of TAAA. May be referred to as TSAA

OGSSAA (Ordered Grid SuperSampling Anti-Aliasing) - Classic SSAA which uses an ordered sampling lattice aligned vertically and horizontally.

RGSSAA (Rotated Grid SuperSampling Anti-Aliasing) - Still the same SSAA, with clarification of the location of the grille tilted at a certain angle. This method performs slightly better than OGSSAA for nearly horizontal or vertical object edges (slightly tilted).

SGSSAA (Sparse Grid SuperSampling Anti-Aliasing, Oversampling smoothing with sparse lattice) - samples are located on a regular grid, as in OGSSAA. But sampling is performed only at some grid nodes. There is a trade-off here between performance and image quality. The method is used by NVidia

JGSSAA (Jittered Grid Super-sampling Anti-aliasing) - each pixel is also divided into subpixels, but the sample selection is located randomly (Stochastic) or with an offset within the subpixel.

HRAA (High-Resolution Anti-Aliasing, Full screen anti-aliasing for high resolutions) - full-screen anti-aliasing method in NVIDIA with 5 samples. Quality as 4xSSAA, load as 2xSSAA.

HRAA (Hybrid Reconstruction Anti-Aliasing) - a solution that uses best practices, based on the edge method (MSAA, CSAA), post-processing with analytics and temporary antialiasing.

EDAA (Edge Detect Anti-Aliasing, Edge Antialiasing) - Also, the edge method + contrast transitions are also calculated on objects and textures. Which ultimately reduces fps more. Conventionally, we can call this an analogue of CSAA, only from AMD. This is a type of CFAA described below.

CFAA (Custom Filter Anti-Aliasing, Specialized anti-aliasing filters) - The brainchild of AMD. Includes 4 filters: box, narrow-tent, wide-tent, edge-detect. Each filter is a different approach to implementing the same MSAA.
box - standard approach to MSAA
narrow-tent - analogue of CSAA
wide-tent - also an analogue of CSAA, only the number of subpixels is twice as large
edge-detect - when the edge detection filter passes through the rendered image, for the pixels it defines, which are defined as polygon boundaries or sharp color transitions, a higher-quality antialiasing method is used with a larger number of samples, and for other pixels with fewer.

QAA ( Quincunx Anti-Aliasing, Checkerboard Anti-aliasing) - a method from NVidia, which is based on taking into account not only its own subpixels, but also data taken from neighboring ones. At the same time, when calculating the final color, your sample has more weight than data from neighboring ones. 5 points are taken into account. In terms of quality, 2xQSAA looks approximately the same as 4xMSAA.

FAA (Fragment Anti-Aliasing, Partial Anti-Aliasing) - developed by Matrox. Anti-aliasing applied to the edges of objects. The difference from SSAA and MSAA is that the edges and objects themselves are not enlarged several times over the mask. Each pixel is divided into 16 parts and if the coverage is complete, then the pixel is sent to the frame buffer; if it is incomplete, then it goes to a separate buffer. Such a pixel is considered fragmented, and further analysis is carried out on it and it is modified. This implementation greatly saves video card resources. But there is also a problem: the edge detection algorithm does not always correctly detect those same edges. The problem with transparent objects in all its glory.

TXAA (Temporal approXimate Anti-Aliasing , Temporal approximate smoothing) - technology from Nvidia that uses the MSAA basis. The calculation formula uses time, pixel data from previous frames, and data from the processed scene. After which averaging by color occurs. This allows you to get rid of flickering and jerking of objects in the game. It gives a high-quality picture at a distance, but it is a little blurry for close objects and the resource requirements are almost the same as for MSAA, although the quality at the same values ​​is better.
According to the manufacturer, TXAA 2x is comparable in quality to 8xMSAA, but at a performance cost comparable to 2xMSAA, and TXAA 4x is higher in quality than 8xMSAA, but at a performance cost comparable to 4xMSAA. Great for dynamic smoothing.

TSSAA (Temporal Super Sampling Anti-Aliasing) - This method is the same as TXAA, but is not tied to NVIDIA video cards and is tied to supersampling.


Second type
The effect on FPS is weak. The so-called post-processing methods, when smoothing occurs at the moment the image is displayed on the screen.

FXAA (Fast approximate Anti-Aliasing , Fast approximate smoothing) - developed by NVidia. As the name suggests, this is a more powerful anti-aliasing compared to traditional MSAA. The algorithm uses a simple method to detect color breaks in shapes. At the moment the image is displayed on the screen, all neighboring pixels are averaged in color. This does not load the video card, but it terribly lathers the frame. Distant and foggy objects in the game will be almost unrecognizable. It makes sense to enable such anti-aliasing on weak machines, laptops, netbooks and other economy options.

MLAA (MorphoLogical Anti-Aliasing , Morphological smoothing) - a conditional analogue of FXAA. The technique was invented by Intel. The algorithm looks for pixel boundaries on each frame, similar to the letters Z, L and U, and mixes the colors of neighboring pixels included in each such part. The algorithm has been converted to use the processor rather than the GPU. Hence, we can recommend it to owners of weak video cards and with a less powerful processor. Due to the more complex algorithm, the image is of higher quality than with FXAA. AMD has an implementation, but technically NVidia can also use it. There is a problem: anti-aliasing does not work on transparent textures. Therefore, in addition to this post-processing, you also need to connect TrAA to improve the image. Processing time takes 0.9 ms. There are also MLAA techniques implemented on the GPU.

S.R.A.A. (Subpixel Reconstruction Anti-Aliasing, Subpixel Reconstruction Anti-Aliasing) - new two-pass algorithm from NVidia. SRAA is very similar to MLAA, but works with depth buffers and normal maps, which is why it is better at identifying edges for anti-aliasing and shadowed edges. The execution time is generally very low, with most of the algorithm's time spent processing shading. Artifacts may appear at the output. For comparison, it takes about 5-10 ms to smooth an image with a resolution of 1280x720 with SSAA, and about 1.8 ms with SRAA.

SMAA (Enhanced Subpixel Morphological Anti-Aliasing , Subpixel morphological smoothing) - combo of MSAA/SSAA and MLAA. Essentially a slightly improved MLAA with the addition of local contrast and pattern search. Sometimes temporary oversampling may also be added. It consumes more resources than MLAA, but it uses the video card, not the processor.
You can find varieties:

  • SMAA 1x: A classic SMAA algorithm that includes precise distance searching, local contrast to detect edges, geometric objects, and diagonal line detection. Processing time takes 1.02 ms.
  • SMAA T2x: SMAA 1x +techniques from TSAA. Processing time takes 1.32 ms.
  • SMAA S2x: SMAA 1x + techniques from MSAA. Processing time takes 2.04 ms.
  • SMAA 4x : SMAA 1x +techniques from SSAA/MSAA and TSAA/TMSAA. Processing time takes 2.34 ms.

CMAA (Conservative Morphological Anti-Aliasing, Conservative Morphological Anti-Aliasing) - average between FXAA and SMAA 1x. Ideal for low to mid-range GPUs. The difference from FXAA is due to the processing of edge lines up to 64 pixels in length. An algorithm is used that only processes symmetrical color breaks to avoid unnecessary blur. The difference from SMAA 1x occurs due to less complete smoothing of objects, because Fewer types of shapes are processed and has increased temporal stability, i.e. less flickering of objects.

Let's start with the definition:

Anti-aliasing is a technology used to eliminate the “jagged” effect that occurs at the edges of many flat or three-dimensional images that are simultaneously displayed on the screen.

Why does jaggedness occur? The problem is that modern PC monitors are made up of square pixels, which means that only horizontal and vertical lines are truly straight. All lines that are at an angle will be built from pixels that are diagonal to each other, which causes “jaggedness”. For example, on the right in the picture there is a seemingly straight line. However, once you enlarge it, it immediately becomes clear that it is not straight:


What does this mean in games? Because, firstly, when moving, a “flickering” effect will occur - such uneven lines will constantly rearrange, which will distract from the game and make the picture unnatural. Secondly, distant objects will look blurry.

The question immediately arises - how to remove these unpleasant effects? The easiest way is to make the pixels smaller for the same screen size (in other words, make the resolution higher and increase the pixel density). Then the “jaggedness” will appear less, and the picture will look more natural. But alas, although the method is simple, it is expensive, and for a video card this is quite a heavy additional load. And then, in order to improve the picture without changing the monitor, anti-aliasing was invented.

Types of smoothing

SSAA (Supersample anti-aliasing)- the most difficult anti-aliasing, because it essentially describes the method of removing ladders, which I gave above: with four-fold (4x) anti-aliasing, the video card prepares an image in a resolution four times higher than what it displays on the screen, then the color of neighboring pixels is averaged and output to screen in original resolution. It turns out that the virtual pixel density is twice as high as that of the screen, and stairs practically cease to be noticeable. It greatly affects performance: for example, if the resolution in a game is 1920x1080, then the video card is forced to prepare a picture in 4K - 3840x2160. However, the result is magnificent - the picture looks like it’s alive, there is no flickering:

MSAA (Multisample anti-aliasing)- an improved version of SSAA that consumes much less resources. For example, why smooth what is inside the texture if there are only ladders at the edges? If the texture is a straight line at an angle towards the player, then you can smooth only one area and continue the effect along the entire edge of the texture. As a result, the load on the video card becomes noticeably less, and in terms of severity, even 8x MSAA turns out to be significantly lighter than 4x SSAA with comparable picture quality.

CSAA and CFAA (Coverage Sampling anti-aliasing and Custom-filter anti-aliasing)- essentially a slightly improved MSAA from Nvidia and AMD (they allow you to select additional pixel “overlap” counts, which can be used to clarify the final color value of the screen pixel falling on the edge of the triangle). 8x CSAA/CFAA provides picture quality comparable to 8x MSAA, but consumes approximately the same amount of resources as 4x MSAA. At the moment, both anti-aliasing is not used - game developers have decided to use anti-aliasing that is unified for all video cards.

FXAA (Fast approXimate anti-aliasing)- undemanding fast anti-aliasing. The algorithm is simple - one pass is made over all pixels of the image and the colors of neighboring pixels are averaged. This lightly loads the video card, but greatly blurs the picture (note the clarity of the stone texture), making distant objects completely unrecognizable:

It makes sense to turn on such anti-aliasing only if you can’t stand ladders, and the video card does not support better anti-aliasing. Essentially, there is a choice between blurring the image and ladders.

MLAA (MorphoLogical anti-aliasing)- analogue of FXAA from Intel. It works in a similar way, but the algorithm is more complicated - the entire image is divided into Z, L and U-shaped parts, and anti-aliasing occurs by mixing the colors of the pixels included in each such part:

Among the features, this is the only anti-aliasing that works entirely on the processor, so it has virtually no effect on fps in games with a powerful processor. Due to the more complex algorithm, the image is of higher quality than with FXAA, but it is still far from 2x MSAA.

SMAA (Subpixel Morphological anti-aliasing)- a mixture of FXAA and MLAA. Essentially a slightly improved MLAA, but running on a video card (since the processor is much less suitable for anti-aliasing). Gives a picture comparable to MLAA, better than FXAA (note the barrels), but consumes more resources:

This anti-aliasing is a good replacement for FXAA, and in terms of load on the video card it is between no anti-aliasing and 2x MSAA, so there is hope that in the future there will be more and more games with it.

TXAA(Temporal antialiasing)- new anti-aliasing technology from Nvidia. Unlike other types of anti-aliasing, which work only with one frame (that is, with a still picture), this can work with moving objects and effectively removes the flickering of the picture. Essentially it is a mixture of MSAA and SMAA, it produces a very high-quality picture, but it is a little soapy and very demanding on resources.

Bottom line

In the end, which anti-aliasing should I choose? If the video card plays the game very poorly, then either stay without anti-aliasing and look at the ladder, or choose FXAA and admire the soap. If the system is more powerful, but MSAA still doesn’t work, you should choose MLAA or SMAA. If the video card easily copes with 8x MSAA, you should look at SSAA or TXAA.

03. 09.2018

Blog of Dmitry Vassiyarov.

What is anti-aliasing in games or comfortable image technology?

Good day to you, my dear readers. And today I have prepared material on the topic of what anti-aliasing is in games. This question is one of the most pressing among gamers. Since knowledge of the nuances of the technologies used in this case allows us to find the optimal compromise between the cost of the hardware platform, the quality of the image on the screen and the realism of the gameplay.

Where do the “steps” come from?

First, let's understand the terminology. Many are accustomed to the fact that smoothness refers to the characteristics of surface texture and can be determined by tactile contact. It's less rough. This means there are fewer elements on its surface that go beyond some conventional line. How does all this relate to computer imaging?

Yes, very simple.

Due to the pixelation of the image, it is almost impossible to obtain a perfectly straight line that is not coaxial with the screen matrix grid. Take a squared sheet of paper from your notebook and imagine that it is a pixel breakdown. Draw a line at a 45 or 30 degree angle.

The most that you can learn from is a figure that resembles steps. The same thing happens with any (straight and curved) lines on the monitor screen (try it in Paint). Moreover, this is noticeable even on high-resolution screens and really irritates our eyesight.

Graphic “grinding” of lines

But it turns out that this visual effect can be leveled out using anti-aliasing technology: you need to make sure that the edges are not so sharply clear. And since we cannot move the pixels, it is enough, by using intermediate halftones in them, to make a smoother boundary transition between two multi-colored figures.

This “antialiasing” technology was created back in 1972 at the Massachusetts Institute of Technology. Initially, the development of the Architecture Machine Group was intended for a more comfortable (for the user) display of text.

As more advanced software products with high-quality video content emerged, anti-aliasing technology also improved. But it was with the active development of modern video games designed to create the most realistic virtual world that many anti-aliasing methods appeared. Their combined use gives a truly amazing effect, but to achieve it you need appropriate hardware resources.

To get a clear understanding of anti-aliasing technologies, you need to know what and when is the object of software processing. First, let me remind you how the image is formed:

  • the mathematical three-dimensional model is processed by the video card (describes and creates and places the images involved in the image);
  • textures, details, shadows, video effects are superimposed on them;
  • the finished three-dimensional model is rendered, as a result of which a two-dimensional image is formed for the next frame.

Antialiasing can be done both at the stage of creating a three-dimensional spatial image, and on a flat image prepared by the video card for sending to the screen. It is not difficult to guess what the chosen processing method affects. In the first case, almost GPU and VRAM resources are used, but this is what they are intended for. Based on this, the following smoothing technologies are distinguished:

Processing with scaling during the formation of 3D images

The first method, SSAA (SuperSample Anti-Aliasing), was used back in DirectX 7. To select the correct halftones on the border pixels, you must initially create a model in a higher resolution. Next, calculate the anti-aliasing parameters and reduce the image again, taking into account the drawing of boundary pixels. What does this do and how does anti-aliasing work?

  • For example, we have a white field of 10 x 10 pixels in which a black circle is drawn (to do this, we draw it with a compass, and paint over the squares in which it falls).
  • Now we will divide each of our original pixels into 4 parts (that is, we will form a 20 x 20 grid) and perform the same operation with drawing a circle.

  • Let's get a situation in which 1, 2, 3 or 4 subpixels will be painted inside the original boundary pixels. In accordance with these values, we fill the original pixels that unite them with different shades of gray, respectively, with a saturation of 25%, 50%, 75%, or again completely black.

After this operation, looking at our image of a circle in a 10 x 10 grid from a certain distance, we will see a more even (without a “ladder” around the edges) and pleasing to the eye figure.

The higher the magnification we use for processing, the more accurate and correct our anti-aliasing turns out. In practice, the software provides options for 2x, 4x, 8x and 16x scaling.

How will this affect the iron?

It is not difficult to calculate that for an image of 1280x1024, processing with a factor of 8x will require a load on a video card corresponding to a model with a resolution of 10240 x 8192 (remember that at this stage we are working with three-dimensional images). Therefore, it is no coincidence that this processing method is called Oversampling Smoothing. And think about whether it's worth turning it on , if your PC has weak hardware

This technology could not remain so resource-intensive. And as an alternative, its version MSAA (Multisample anti-aliasing) was proposed. Its main difference from the previous one is that anti-aliasing was applied only to visible lines and surfaces (which is quite logical).

As a result of this processing, one significant drawback was discovered for gaming gourmets: objects placed under water or behind glass looked clearer and sharper.

Nvidia decided to improve MSAA and created a method of anti-aliasing with coverage sampling - CSAA (Coverage Sampling anti-aliasing). Here, software graphics processing algorithms provided in the GPU chip itself are actively used.

In this case, the points of the main and background objects are involved in the smoothing calculation. This technology significantly saves resources. After all, to obtain a high-quality result, it is enough for her to use a lower magnification factor of the image.

Based on the developments described above, NVidia created a way to perform anti-aliasing in the context of a changing scene. This makes it possible, even at low FPS, to practically eliminate twitching and flickering of objects displayed in the square.

This is TXAA (Temporal approXimate Anti-Aliasing) technology. In the algorithm, taking into account time, pixels from previous and processed frames are taken into account, followed by color averaging.

Post-processing of finished frames

But it is not at all necessary to apply anti-aliasing to volumetric 3D models. After all, similar processing can be performed after rendering.

  • For those with weak computer hardware, NVidia has offered a fairly effective solution, FXAA (Fast approXimate anti-aliasing). If you believe the name, it works quite quickly, which is achieved by processing ready-made images. For contour lines, mathematical color processing methods are used, which make it possible to obtain pronounced anti-aliasing. Sometimes it’s even too “smooth”, because the disadvantage of this method is excessive blurring of the picture. But still, the resulting result makes the image more pleasant than before processing.

  • For those who generally have a graphics card that is not intended for modern games, but have a powerful CPU, Intel offers its analogue of the above-described MLAA method. Processing is slower, but the developers managed to get rid of noticeable blurring.

  • Taking into account the trend towards increasing fps of video streams, specialists from NVidia created MFAA (Multiframe Sampled Anti-Aliasing) technology specifically for these conditions. To speed up frame processing, a unique and simple algorithm is used here. Inside the pixel through which the contour line passes, two conditional points are created. And depending on the relative position of the line and markers, the color value is set.

I have presented to you only the most common antialiasing methods, which give an idea of ​​the processing process itself. In fact, there are now quite a large number of anti-aliasing technologies. The story about which will take a lot of time.

I hope you found the article useful and interesting. With that, I say goodbye, good luck and have a nice game.