Anti-aliasing principle

The article is reprinted at: http://geekfaner.com/unity/blog9_AA.html

This is a great article I saw online and I would like to share it with you.

When I played Cocos before , I didn’t need anti-aliasing because the 2D game played horizontally and vertically without any aliasing. At that time, I heard that AA must be turned on to make 3D games. But I have been making 3D games for a few years now, but AA is still not used much in the project. The reason is because of the performance issues of mobile games. If AA is not turned on, the aliasing will be really serious, so I will use an article to study the effects and performance of various AAs to facilitate future trade-offs.

First, reprint two articles in movie-level high quality! Analysis of 3D game anti-aliasing technology and comparison of which one is better and which one is worse, comparison of 7 types of anti-aliasing effects

The origin of jagged image edges from shallow to deep

We know that computer screens are made up of small pixels. Although these pixels are very small, each pixel covers a certain area on the screen. We can compare these pixels to windows leading to the virtual world, and the computer's task is to determine the color of each pixel so that we can see the most beautiful picture through these windows.

aa

However, the rendering speed is also an important factor to consider for a "real-time" picture, so usually the color of a pixel is determined by the color obtained by sampling a certain point within the pixel (that is, what we call point sampling Point Sampling). Unfortunately, this approach in order to increase speed may result in the sampled color of a single point not reflecting the color condition of the entire area covered by the pixel. This is very obvious when it occurs at the edge of an object.

aa aa

There are some pixels "across" the edge of the object. The color inside the pixel has a certain proportion, and we also want to reflect this proportion in the external display. The edges of the object will appear different colors on both sides. Point sampling technology will make the entire pixel appear a certain color on both sides of the edge. Regardless of whether the edge of an object is colored with a foreground color or a background color, it will naturally appear jagged due to the sudden jump in color between pixels.

We know that CRT, LCD and plasma displays all use pixels to display pictures. When displaying pictures, there are often multiple colors, but one pixel can only display one color, so one pixel often displays one color, and it The one next to it shows another color, which creates a jagged edge.

This situation is what we call Aliasing. This is because the area of ​​​​this pixel exactly covers the edge, and it exists on both sides. A better approach is to mix the foreground and background colors to create a third color that fills one pixel. This method can effectively improve the performance of image edges. In other words, it achieves the effect of "anti-aliasing".

aa aa aa aa

Anti-aliasing: The standard translation is "anti-image folding distortion". Because in 3D images, subject to resolution constraints, the edges of objects will always appear more or less triangular in aliasing, and anti-aliasing refers to softening the edges of the image to make the edges of the image look smoother and closer to the real thing. object. It is a way to improve the quality of the picture to soften it.

aa

Nowadays, the latest full-screen anti-aliasing FSAA (FullScene Anti-Aliasing) can effectively eliminate the misalignment at the junction of polygons (especially in the combination of smaller polygons) and reduce the distortion of the image. When panoramic anti-aliasing is processed, pixels near the image must be sampled to achieve different levels of anti-aliasing effects. Simply put, it mixes the pixel colors on the edge of the image and its sides, and then replaces the points at the original position with newly generated points with mixing characteristics to achieve the effect of softening the shape of the object and eliminating aliasing.

Anti-aliasing can basically be understood as a mathematical algorithm: calculating the "average color" that a pixel should be assigned. To calculate the "average color", sampling is required. The larger the sample space, the better the picture quality, and the longer the calculation time required.

AA is divided into many types: the traditional anti-aliasing technology "Full Screen Anti-Aliasing/FSAA", including super sampling anti-aliasing (SSAA) , multi-sampling anti-aliasing (MSAA) , coverage sampling anti-aliasing (CSAA) , programmable filter anti-aliasing ( CFAA) . Later, MLAA , FXAA , TXAA , and SMAA based on post-processing appeared . (Patrick: In terms of cost-effectiveness, FXAA is the most cost-effective, followed by SMAA and MSAA, of which MSAA has the best effect. Therefore, FXAA is currently used most in mobile games (such as Honkai Impact 3). There are many kinds of FXAA algorithms. Currently, I Using NVdia’s FXAA)

Super-Sampling Anti-aliasing (SSAA) is an early anti-aliasing method that consumes more resources, but is simple and direct. First, map the image to the cache and enlarge it, and then use super sampling to enlarge the enlarged image. To sample pixels, usually 2 or 4 adjacent pixels are selected. After mixing these samples, the final pixel generated will make each pixel have the characteristics of adjacent pixels, and the transition color between pixels will become similar. Smoothes the color transition at the edges of graphics. Then the final pixels are restored to the original size of the image, and saved to the frame buffer, which is the video memory, stored instead of the original image, and finally output to the monitor to display a frame.

aa

This is equivalent to taking a blurry big picture and then reducing it into a clear small picture through refinement. While the display size remains unchanged, the resolution is increased and individual pixels are made extremely small, which can greatly reduce the aliasing of the screen. If every frame is anti-aliased, every frame in a game or video will be anti-aliased. When mapping an image into a cache and upscaling it, the magnification factor is used for separate anti-aliasing effects. However, due to the amplification of the entire display screen, the display resources it consumes are also very large.

There are generally two sampling methods used in super-sampling anti-aliasing: Ordered Grid Super-Sampling (OGSS), which selects two adjacent pixels when sampling. Rotated Grid Super-Sampling (RGSS for short) selects 4 adjacent pixels when sampling.

MSAA is the English abbreviation of MultiSampling Anti-Aliasing, which refers to multi-sampling anti-aliasing. The principle is to find the pixels on the edge of the object, and then scale the painting to the current display. It is an upgraded version of SSAA . MSAA finds the pixels on the edge of the object and then scales them. Since only the outer pixels of the object are scaled, the internal pixels that will not produce aliasing are ignored, so the graphics card does not require a huge amount of calculations like SSAA (Super Sampling Anti-Aliasing) , so MSAA is more efficient than SSAA . .

The following is an answer from Zhihu xiaocai , original link: https://www.zhihu.com/question/58595055/answer/157756410

For information about MSAA, please refer to the official specification document. OpenGL is maintained by Khronos: https://khronos.org/registry/OpenGL/index_gl.php. In fact, many of the contents are in the Red and Blue Book. DX is maintained by Microsoft, but only the upper part is exposed through DX's SDK documentation or Rasterization Rules.

先贴出OpenGL官方描述:First, each fragment includes a coverage value with the value of SAMPLES bits Second, each fragment includes SAMPLES depth values and sets of associated data, instead of the single depth value and set of associated data that is maintained in single-sample rendering mode. An implementation may choose to assign the same associated data to more than one sample. The location for evaluating such associated data can be anywhere within the pixel including the fragment center or any of the sample locations. The different associated data values need not all be evaluated at the same location. Each pixel fragment thus consists of integer x and y grid coordinates, SAMPLES depth values and sets of associated data, and a coverage value with a maximum of SAMPLES bits.

The entire answer takes MSAA4x as an example. The official description is that each pixel has a 4-bit coverage mask, and 4 depth values ​​(one for each sample), and there are other attributes (the simplest is color), and it can Take a color copy to all samples (to be precise, only copy to those samples with non-zero mask), and this color can come from the pixel center or a certain sample. (Patrick: Personal understanding is that each sample should be sampled in the corresponding place. The detailed explanation is as follows)

After msaa is turned on, each pixel is only executed once by default, which is Pixel Frequency. That is to say, PS only executes the calculation of the color at the center of each pixel, and then copies it to 4 samples. Of course, as mentioned before, this copy does not necessarily come from the center of the pixel, but can also be from other positions of the pixel. For example, if the interpolation method of color is declared as Centroid in DX, then when the center of the pixel is not inside the triangle (but there is Sample inside the triangle) , the Sample within the triangle will be selected to avoid "Outerpolate". The advantage of Pixel Frequency is that PS is still 1x, which reduces consumption, but sometimes the visual effect is not very good, so you can also turn on Sample Frequency, which requires four samples of a pixel to be executed by 4 PS respectively, and each sample calculates its own color. You can refer to the description of ARB_sample_shading: https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_sample_shading.txt.

The default algorithm of 4xmsaa is to add the colors sampled at the location of each sample and divide it by 4.

Regardless of Pixel Frequency or Sample Frequuncy, the depth is always 4x, that is, each sample has its own depth. Let's go back to the concept of "valid" sample. The sample that fails the depth test is invalid, and the color output by PS will not be copied to it. If all four sample depth tests fail, the pixel is discarded.

Take 4xMSAAMSAA as an example. When turned on, the resolution is Do the Z test at the sample level (the test passes if the Z of the current pixel is smaller than the Z in the buffer). The final pixel color is the average of the four samples, and 100*100 is obtained through Bilinear resolve. The color of each sample may come from different triangles, as shown on the left side of the picture below (the final color should be (red + green)/2). There are multiple triangles covering the same sample. Of course, choose the final Z test pass that is closest to the eyes, as shown on the right side of the picture below (the final color should be (red + background color)/2). In short, it is the average value of the four sample colors. The sample that is not covered by any triangle naturally takes the background color.

aa

Although MSAA has been widely used, one important flaw is that it cannot handle Alpha materials, so it cannot work on some slender objects such as fences, leaves, barbed wire, etc. In order to solve this problem, ATI added adaptive anti-aliasing to the X1000 series, which forcibly improves image quality through additional multi-sampling and even super-sampling. Adaptive anti-aliasing can selectively perform multi-level or super-sampling specifically for Alpha materials. This results in lower performance loss than using SSAA entirely, and the picture quality is still perfect! (Patrick: Can’t we use MSAA’s A2C to process Alpha materials?)

aa

Coverage Sampling Anti-Aliasing (CSAA for short) is an anti-aliasing technology that appeared when the NVIDIA G80 series appeared. Its principle is to overwrite the sub-pixel coordinates that need to be sampled in the edge polygon, and force the original pixel coordinates to be placed in the coordinates pre-calculated by the hardware and driver. This is like MSAA with unified sampling standards, which can run edge sampling with the highest efficiency, significantly improve traffic, and consume relatively low resources. (Patrick: So it only applies to NV graphics cards? It looks the same as MSAA. I don’t know what the specific implementation is, TODO)

Programmable filter anti-aliasing (Custom Filter Anti-Aliasing) technology originated from AMD's R600 family. Simply put, CFAA is MSAA that expands the sampling area. For example, the previous MSAA strictly selected the edge pixels of the object for scaling, while CFAA can flexibly choose to scale the pixels that have a greater impact on the aliasing effect through the driver. Performance is sacrificed in exchange for smooth effects. The graphics card resource usage is also relatively small. (Patrick: So it’s only applicable to AMD graphics cards? No wonder it’s called programmable. It can also perform AA selectively at the pixel level. It’s amazing... I don’t know what the specific implementation is, TODO)

Since the release of G80, NVIDIA's CSAA technology has been recognized by more and more game developers. I believe many players have noticed that many games now provide CSAA options directly in the menu. N card users do not need to enter the driver control panel. It is very convenient to call. Although AMD's CFAA has been used from the HD2000 era to the HD5000 era, almost no one cares about it.

Finally, in the HD6000 era, AMD abandoned CFAA, which had little practical value, and developed a new anti-aliasing solution - Morphological AA, literally translated as morphological anti-aliasing. This kind of anti-aliasing uses DirectCompute computing technology for high-efficiency post-processor filtering. The new anti-aliasing mode has a wider application range than traditional MSAA, and the accuracy can be up to 24x, which is more efficient than SSAA (Super Sampling Anti-Aliasing). Much faster, almost the same as the highest-precision CFAA, but with better image quality. (Patrick: So it is only suitable for AMD graphics cards? It seems that it can only be used on top-end PCs. The best effect + corresponding performance... I don’t know what the specific implementation is, TODO)

aa

Although FSAA full-screen anti-aliasing technology is very mature, no matter how it develops, one of the biggest drawbacks of FSAA cannot be avoided, which is that the anti-aliased image will become blurry, affecting the visual effect. Moreover, for mainstream MSAA, the number of frames will be greatly reduced after opening 4 times or more, affecting performance. Today, when image quality is becoming more and more realistic, the terms blur and inefficiency must be eliminated. Therefore, the new anti-aliasing technologies that will be discussed today are derived: FXAA and TXAA. (Patrick: This paragraph is reproduced from http://diy.pconline.com.cn/graphics/study_gra/1208/2922104_all.html#content_page_3. I don’t know whether FXAA or FSAA is blurred...)

Fast Approximate Anti-Aliasing is a high-performance approximation of the traditional MSAA (Multiple Sampling Anti-Aliasing) effect. It is a single-pass pixel shader that runs in the post-processing stage of the target game rendering pipeline like MLAA, but does not use DirectCompute like the latter. It is a pure post-processing shader and does not rely on any GPU computing API . Because of this, FXAA technology has no special requirements for graphics cards and is fully compatible with different graphics cards from NVIDIA and AMD (MLAA only supports A cards) and DX9, DX10, and DX11.

A comprehensive and detailed explanation of fast approximate anti-aliasing FXAA

Currently, the only software that can test FXAA image quality is an SDK demonstration program launched by NVIDIA. This program can test the image quality performance of MSAA and FXAA at different resolutions. MSAA can be set to a maximum of 4AA, while FXAA uses The grading adjustment is up to level 5, and MSAA and FXAA can be turned on at the same time to further eliminate aliasing, but the performance will drop a lot.

However, it should be noted that morphological anti-aliasing is not useful under depth of field effects and motion blur. However, FXAA achieves the same image quality compared to FSAA, but greatly reduces the computing pressure, which can be seen in the actual performance test below. Therefore, FXAA represents the future direction of 3D image quality and speed, so that players do not need to worry about spears and shields. It is an anti-aliasing technology with great potential.

FXAA is a post-production stage of rendering. This form of anti-aliasing only requires edge detection and key pixel selection, and does not involve resampling, which is very friendly to system resources. The burden is almost all on the rendering backend, and shader resources can be greatly saved.

aa

Fast approximate anti-aliasing (FXAA) image quality performance

aa

The above is the image quality difference tested in the official Demo provided by NVIDIA. The left side shows the state without any AA being turned on. You can see that the difference is quite obvious around the railings. The middle and right show the status of turning on 4xMSAA and level 3 FXAA respectively. You can see that the edge of the fence has become significantly smoother, and the image quality gap between the two is not obvious.

Fast approximate anti-aliasing (FXAA) algorithm process

aa

As for TXAA, it is an anti-aliasing technology with more potential. When the new Kepler architecture graphics card GTX680 was released, NVIDIA announced that a new anti-aliasing technology was coming, called TXAA.

The principle of TXAA is to provide color correction processing at the hardware level through the HDR post-processing pipeline. The post-processing method is actually similar to FXAA: integrating hardware AA and complex high-quality filters similar to those used in CG movies. Reduce tearing and judder in anti-aliasing.

The principle of TXAA is to provide color correction processing at the hardware level through the HDR post-processing pipeline. The post-processing method is actually similar to FXAA: integrating hardware AA and complex high-quality filters similar to those used in CG movies. Reduce tearing and judder in anti-aliasing.

Therefore, TXAA is a new type of anti-aliasing, and it requires re-development of code that adds TXAA to support it. Therefore, there is currently no game on the market that supports TXAA. However, as NVIDIA advances, it is estimated that TXAA will have more and more games.

The second Beta driver 304.79 of the R304 series recently released by NVIDIA has added support for NVIDIA TXAA anti-aliasing technology. The Secret World mentioned in it will become the first game to support TXAA technology (support will be updated in the upcoming patch) turn on later). The actual picture quality and performance experience will be known after the release.

Currently, TXAA is divided into two levels: TXAA1 and TXAA2. TXAA1 can achieve the effect of 8x MSAA, with execution efficiency equivalent to 2x MSAA, while TXAA2 will provide higher picture quality. (Patrick: I need to see the algorithm of TXAA before talking about it... Because some friends said that txaa is a big pit, it is easy to use, but it will cause a lot of problems, which must be solved accordingly)

aa

smaa algorithm website:

http://www.zcom.com/article/63151/
http://www.expreview.com/17878-3.html

There is also PostAA used by cryengine. How to implement this requires looking at the source code of ce to find out. Some people also say that postaa is derived from the smaa algorithm.

  • Supersampled Anti-Aliasing (SSAA)
  • Multisampling Anti-Aliasing (MSAA)

  • aa

    1) PS (Pixel Shader, fragment shader) is only responsible for calculating the color of each pixel/sample. It does not know how many samples are covered and valid for each pixel. In fact, PS itself may discard the sample. . 2) It is necessary to execute after cutting (scissor reject). To get the coverage mask, it not only depends on whether the four samples are covered by triangles (rasterization), but also whether it is inside the scissor. For example, all 4 samples of a certain pixel are covered by triangle, but only 2 samples may be in scissor, so the "synthesis" operation is impossible to do in PS, because PS does not have the required information. 3) At least it is impossible to complete the resolve in the PS of the first pass. Generally, it is difficult to get the bottom layer in place in one pass, because 4x is essentially 4x of the intermediate data. One pass can get 4x depth and color, but the final display is 1x. Image, at the Output Merger stage, generally no resources will be added for DownSample. Therefore, 4x color is usually written to the buffer, and then a pass (invisible to the upper layer) of PS is used for Down Sampling to obtain the color of each pixel, which is still 1x color. (Patrick: So the time point for multisampling execution is: rasterization > fragment shader > clipping test > msaa)

    Alpha to Coverage only works when MSAA Enable is enabled, because it changes the color by changing the coverage mask (through the AND operation). A2C uses MSAA and will not affect other results. Compare AlphaTest, Alpha to Coverage and Alpha Blend together: Alpha Test order is irrelevant, but edge effects are poor. Alpha Blend has better edge effects, but requires strict order. To a certain extent, Alpha to Coverage can be understood as a sample-level Alpha Test, which converts Alpha into a mask to achieve a smooth transition. If you understand that the order of Alpha Test is irrelevant, you will also understand that the order of Alpha to Coverage is irrelevant.

    Regarding supersample and MSAAMSAA, the default is pixel frequency. When sample frequncy is turned on, I think it should be counted as supersampling. Stack Overflow has a similar question also mentioned: Multisampling in pipeline. The difference between supersampling and MSAA is whether PS performs per-pixel or per-sample execution on each pixel. MSAA also processes all positions, not just edges. Just because the internal pixel coverage mask of the triangle is 1111, the final color is still equal to Pixel center color. (Patrick: Really? I'm skeptical... Because there are also documents that say this: MSAA only performs super-sampling anti-aliasing on the data in the Z-buffer (Z-Buffer) and stencil buffer (Stencil Buffer). It can be easily understood. In order to perform anti-aliasing only on the edges of polygons. In this case, MSAA's resource consumption requirements are greatly reduced compared to SSAA's processing of all data in the picture, but the image quality may be slightly inferior to SSAA.)

    aa
  • Adaptive Anti-Aliasing (AAA)
  • Coverage Sampling Anti-Aliasing (CSAA)
  • Programmable Filtered Anti-Aliasing (CFAA)
  • Morphological Anti-Aliasing (MLAA)
  • Fast Approximate Anti-Aliasing (FXAA)
    • (Patrick: Is it so complicated? I don’t even understand it..., TODO)
    • FXAA treats this as input non-linear RGB color data and internally converts this data into a scalar brightness estimate for the shader logic unit.
    • Check local contrast to avoid processing into non-edge parts. The detected edge is in red, and the yellowish part included represents how much sub-pixel jaggedness is detected.
    • Pixels that pass the local contrast test are then classified as horizontal (shown in gold) or vertical (shown in blue).
    • It is assumed that the orientation of the edge is selected and the pair of pixels at 90 degrees to the edge with the highest contrast, represented in blue/green.
    • The algorithm searches for positive and negative (red/blue) edge ends in the direction of the edge, checking for significant changes in the average brightness of high-contrast pixel pairs along the edge.
    • Assuming that the end of the edge, the pixel position on the edge has been converted into a sub-pixel displacement 90 degrees perpendicular to the edge to reduce aliasing, red/blue represents -/+ horizontal displacement, while gold/sky blue represents -/+ vertical displacement.
    • Taking this subpixel offset into account, the input texture is resampled.
    • Finally, a low-pass filter is synthesized based on how much sub-pixel aliasing is detected.
  • THAI
  • SMALL
  • PostAA

Below we will look at the differences between different anti-aliasing through actual performance in several games.

testing platform

aa

"The Elder Scrolls 5: Skyrim"

aa

"Mass Effect 3"

aa

"Borderlands"

aa

From "The Elder Scrolls V: Skyrim", we can see that Adaptive AA and even EQAA perform well, especially when processing leaves, and the performance drop is reasonable. The next time you launch Skyrim or Far Cry on DX 9, remember to set the AA settings in Control Center to Adaptive AA.

Although the performance is not perfect, MSAA's performance in some cases is worthy of recognition.

If you like a little fuzzy feel, then FXAA has you covered. Most FXAA will bring HDR, Bloom and other special effects, which makes many people mistakenly think that FXAA is better, but not everyone likes this kind of special effects. Although it is 10 times better than MLAA, it is still blurry, so if you like sharp effects, then FXAA is not for you. (Patrick: Some people below also said that FSAA is blurry. I don’t know which one is blurry, FXAA or FSAA.)

The performance of SMAA based on AMD MLAA is really not very good. In "Mass Effect 3", the performance of SMAA is not as good as MLAA. Although I heard that its performance in "Battlefield 3" is not bad, it is only good in "Battlefield 3".

Not all AA are applicable to all GPUs. For example, EQAA is not applicable to the HD69xx series, while Sparse Grid AA is only applicable to NVIDIA graphics cards. Adaptive and SuperSample are AMD's proprietary technologies.

DiRT 2 FXAA’s multiple advantages are fully unleashed

The "Colin McRae" series of games was produced in memory of the deceased British rally driver Colin McRae, so it is not difficult to see many figures from McRae's past during the game. Different from the best series of racing games that come out every year, DiRT2 has been two years since its predecessor. Currently, the console version of "Colin McRae: Dirt 2" has been launched for a long time. It has been launched on almost all consoles and handheld platforms and has received rave reviews. The PC version has been delayed for several months because it supports DX11.

Image quality comparison

aa

Performance Testing

aa

From the comparison screenshots, you can see that when all AA is turned off, the picture is extremely rough and seriously affects the game experience. When high-magnification MSAA is gradually turned on, the image quality is significantly improved, but the performance decreases significantly. When FXAA is turned on, the image quality improvement is more obvious than MSAA. When FXAA is turned on alone, it is already close to the level of 4xMSAA, and 4xMSAA+FXAA is even better than 8xMSAA. In addition, under the same image quality, the performance loss of FXAA is also significantly better than that of MSAA.

Eagle Strikes the Sky AA has little impact on picture quality

"Eagle Strike" was developed and produced by Bucharest Studio, a subsidiary of Ubisoft. It is based on the modern international conflicts that Tom Clancy is best at, coupled with modern military weapons, and is under development that the Pentagon is unwilling to confirm. advanced weapons, interweaving the most intense high-tech offensive and defensive battles. "Eagle Strikes the Sky" also breaks away from the framework of the previous works, pulling the war from the ground to the air, and enjoying a vast and boundless battle space.

Image quality comparison

aa

Performance Testing

aa

As an air combat game, the only object that players can clearly see in detail in the game seems to be their own fighter plane. In this game, the impact of anti-aliasing on image quality is not very high, but the performance has declined rapidly, which seems to be more than worth the gain.

Far Cry FXAA efficiency is lower than 4AA

Since the copyright of the "Far Cry" series was purchased by UBI, the company's Montreal branch has begun to develop a new game. Not only has the development work of this game been transferred from Crytek to UBI, but the story background of the game has nothing to do with the previous game. Graphics and physics engine completely reworked from UBI side.

Image quality comparison

aa

Performance Testing

aa

Similar to the situation in "Dirt 2", the "burrs" on the edges of objects are quite obvious when anti-aliasing is turned off. After turning on FXAA, the image quality instantly reached the level of 4xMSAA, but the frame rate was slightly lower than 4xMSAA at this time.

World of Conflict 4AA+FXAA no pressure

"World in Conflict" will take players back to the famous Cold War period, where every decision of the player affects the characters and plot in the game. You can feel the different team spirit in the game and fight with your teammates on the eerie battlefield. "Soviet Attack" is its latest expansion pack, including new characters, playing Soviet troops, 10 new videos, new multiplayer maps, and more.

Image quality comparison

aa

Performance Testing

aa

Real-time strategy games have always placed dual requirements on the GPU and CPU. In the test, the graphics card is no longer the bottleneck of the game, and the performance decline is not obvious when high-power MSAA and FXAA are turned on. In terms of image quality, only when 4xMSAA and FXAA are turned on at the same time, the shadows on the ground will show a "straight line" effect.

Need for Speed ​​15's highest AA also has rough edges

EA's new sequel to the classic racing game "Need for Speed ​​​​15: Gear 2" has become one of the most popular games in the game market. Previously, this series was released at the rate of one new game every year. With each new generation of games released, players would have fierce debates about the game's image quality, control experience and other conveniences. It is precisely with so many loyal players that this racing game continues to thrive.

Image quality comparison

aa

Performance Testing

aa

The "Need for Speed" series of games have always had obvious aliasing on the screen. Even if MSAA is adjusted to the highest setting in the image quality options, aliasing can still be clearly seen. Fortunately, FXAA can further improve the picture quality.

Metro 2033 puts top graphics cards to shame

The DX11 masterpiece "Metro 2033" uses a DX11-level depth-of-field effect. The clarity and blur are reasonably distributed and prioritized. Coupled with the assistance of Tessellation technology, it is almost close to the shooting effect of a movie, and it looks pleasing to the eye. But the game is very demanding because it uses so many cutting-edge graphics technologies.

Image quality comparison

aa

Performance Testing

aa

"Metro 2033" is one of the few games to add AAA adaptive anti-aliasing. You can see from the screenshot that 4xMSAA and FXAA need to be turned on at the same time to make the edge of the object show a perfect "slash". At this time, the GTX580 is no longer smooth. run game.

Native support for FXAA in Duke Nukem options

From 1997 to 2011, 14 years of waiting, 14 years of expectation, 14 years of time flew by. Some people waited, but many people failed to wait. These 14 years are already a long time in life. They are the most glorious days in a generation's life. But for a game, it is incredible to make players wait for 14 years. However, "Duke Nukem Forever" did it. , at least at this point, it is already a masterpiece!

Image quality comparison

aa

Performance Testing

aa

As mentioned before, "Duke Nukem Forever" is the first game that the editor has tested to include FXAA in the image quality options. However, this game does not have rich support for other AA, with only three options to choose from ( NO AA, FSAA, FXAA).

Unreal Engine 3 games can also enable FXAA

As the follow-up version of "the game with the most covers", "Assassin's Creed: Brotherhood" introduces an unprecedented multiplayer mode for the first time on the basis of ensuring a rigorous story-driven single-player mission. The game provides multiple different types of characters. It also provides a large number of new weapons, which will greatly improve the gameplay compared to the previous game.

Image quality comparison

aa

Performance Testing

aa

Like most "Unreal Engine 3" engine games, "Assassin's Creed: Brotherhood" cannot properly turn on MSAA in the game, which will definitely make most players extremely unhappy. Fortunately, FXAA can be turned on normally in this game, and the image quality is significantly improved.

The revolution has not yet succeeded, FXAA still needs to work hard

I believe attentive netizens have seen that in this test, most of the games tested were DX9 and DX10 games, but the latest DX11 games were very few. In fact, this is not because the editor was lazy during the test, but because after careful testing, the editor found that FXAA does not take effect in all games, especially in most DX11 games, some abnormal situations will occur. This shows that the compatibility of FXAA at this stage still needs to be improved.

Despite this, we can still see many highlights of FXAA through our tests. First of all, FXAA improves the image quality quite obviously. Turning on FXAA alone can get an image quality of 2xMSAA or more and close to 4xMSAA. Secondly, it consumes less graphics card performance. , close to the level of 2xMSAA, allowing players to get a better experience with less performance loss; in addition, FXAA can also be used in combination with other AA technologies to improve the image quality to a higher level.

It is hoped that NVIDIA/AMD can join forces with many game manufacturers to vigorously promote FXAA technology, and ultimately enable users to turn on FXAA in the driver control panel and game settings according to their own needs, so as to get the most realistic gaming experience in the game.

Unity post processAA

It’s amazing to be able to see this place all the time. I don’t know who else can see this place all the time except me.

Originally I thought this article would end like this, but the project team is still not satisfied with the effect of AA, which is embarrassing. It seems that things are clearer. The effect of MSAA is better, but it is more energy-consuming (and it will be the same as OpenGL ES 2.0) . FBO conflicts , deferred rendering and HDR of some versions of Unity do not support MSAA), FXAA is more economical, but it will be a bit blurry and the effect is not as good as MSAA. Just choose one of the two solutions, but the project team asked if they can find a better FXAA. This is very embarrassing. At present, I have implemented two sets of FXAA (one is copied from opengl es cookbook, and the other is fxaa from nvdia). I can only cast a wide net to see more FXAA algorithms. The first thing to look at is Unity's own post process AA.

The post-processing stack in Unity is a set of post processes. The advantages of defining this set are: 1. Multiple PPs can be executed in the correct order; 2. Multiple PPs are put into one pass. PP stack recommends using linear + HDR + deferred rendering path.

Fast Approximate Anti-aliasing (FXAA)

FXAA is the most economical AA and is suitable for mobile phones and other platforms

TAA

TAA is more advanced, it needs to use the buffer of the previous frame for calculation, and the platform needs to support motion vector. This kind of edge AA is more effective, but more energy-consuming. Basically used on PC or console.

Guess you like

Origin blog.csdn.net/qq_33515628/article/details/109480931