Anti-aliasing (AA, Anti-aliasing)

1. SSAA (super sampling anti-aliasing): each pixel generates N sampling points, each sampling point executes a fragment shader, has independent color and depth storage space, and finally accumulates the data of each sampling point to obtain an output, It can be roughly understood as a way to enlarge the picture by N and compress it back to the size of the original picture. The quality of AA is excellent, operation N, space occupation color N, depth N.

finalVal = (V0 + V1 ...... + V (n-1)) / N

 

2. MSAA (multi-sampling anti-aliasing): each pixel generates N sampling points. After each pixel performs a fragment shader, the result is written to the sampling point located in the target primitive. The N sampling point data are accumulated and output. . The quality of AA is excellent, operation 1, space occupation color N, depth N.

finalVal = (VP0 + VP1 ...... VP (x-1) + VU0 + VU1 ...... + VU (y-1)) / N (VP indicates the sample of the sampling point located in the target primitive Value, VU represents the initial value of the sample point located outside the target primitive, x + y = N)

 

3. CSAA (coverage sampleing anti-aliasing): divide the generated N sampling points into several areas, such as upper left, lower left, upper right, and lower right. Each area stores a copy of color, depth and the number of sampling points in the area. coverage value, after each fragment shader is executed once, the result is written to the area where the sampling point located in the target primitive is written, and the coverage value corresponding to each sampling point is also written. The area value and the coverage are calculated and added to obtain the average Output. AA works well, operation 1, space occupancy color M, depth M, coverage N (M is the number of sampled areas divided, the storage of storage is N but the consumption is small, when M and N achieve a certain balance, CSAA can be in a certain To a certain extent, reduce storage overhead).

finalVal = (VA0 * (VC0 + VC1 ...... + VC (x-1)) + VA1 * (VC0 + VC1 ...... + VC (y-1)) ...... + VA (m-1) * (VC0 + VC1 ...... + VC (z-1))) / M (VA is the area storage value, VC is the coverage value of the corresponding sampling point in the area, x, y , Z is the number of sampling points in each area)

 

4. Most of the hardware of MSAA, SSAA, and CSAA have been directly supported, but the consumption of computing and storage space needs constant attention.

 

5. Edge AA: Perform edge detection based on the difference between the depth and normal of adjacent pixels to generate a weight to interpolate between adjacent pixels. The main purpose is to process by points.

 

6. MLAA (morphological anti-aliasing): a CPU-based processing scheme introduced by Intel, which classifies Edge into several specific shapes such as Z, U, and L, and finally decomposes it into L to determine a triangular mixed area, according to the specific implementation It is also divided into CPU MLAA, GPU MLAA, Jimenez's MLAA and so on.

 

7. FXAA (fast approximate anti-aliasing): NVIDIA provides a solution close to MLAA, which only recognizes the long side rather than the shape, and mixes after calculating the coverage of each sample of the pixel according to the straight line equation of the long side.

 

8. DLAA (directionally localized anti-aliasing): Perform horizontal edge detection on the image blurred in the vertical direction, and the results obtained are synthesized back (feeling similar to Gaussian blur).

 

9, Edge AA, MLAA, FXAA, DLAA are all post-processing AA.

 

10. SRAA (subpixel reconstruction anti-aliasing): The fact that it is pinned to is that the changing frequency of shading is generally lower than the changing frequency of geometry, so it can be shading at a lower resolution and restore the geometry at a higher resolution. The basic process of SRAA is that in the framework of Deferred Shading, a high-resolution (or with MSAA) G-Buffer is rendered, but when shading, it is only done at a normal resolution (or without MSAA). The accumulated result reconstructs sub-pixel information through G-Buffer to perform AA calculation similar to MLAA.

 

11. GPAA (geometric post-process anti-aliasing): After the scene is rendered, the scene is rendered in wireframe mode again. At this time, the coverage of each triangle to the pixel sampling point can be obtained, and then DLAA or CSAA is performed. AA is enough .

 

Guess you like

Origin www.cnblogs.com/haihuahuang/p/12743396.html