The display is composed of discrete grids, so there is a "sawtooth" in the display of the image. To solve this problem, people think of a way to "anti-aliasing )". It is called "supersampling", and it works in the same way as its name. It requires "super" capabilities to work well. when this technique is used, the sizes of "back buffer" and "depth buffer" are set to X times the screen resolution. then the 3D scenario is rendered to the backup buffer. When the backup buffer content is displayed on the screen, the pixels in the backup buffer are mixed, for example, X pixels are mixed into one pixel color. this method is more violent, so it eats hardware. because of the high cost of super sampling, Direct3D supports a similar technology called "Multi-sample )". the idea is that super sampling is basically the same, but it works like this: for example, we use 4 times of Multi-sampling, and then the buffer and depth buffer are four times the screen resolution, however, at this time, we do not calculate every pixel, but only one pixel. The pixel to be calculated is located at the center of Four pixels, the color information of these four pixels is shared with the information of the pixel calculated in the middle. one aspect of ms's "efficiency" over ss is that he reduced the original four Pixel Information calculations to one. of course there will be loss, ms is not as accurate as ss.
In dx11, you can use ID3D11Device: CheckMultiSampleQualityLevels (...) to query the hardware's multi-sampling capability.
Example:
1 UINT msaaQuality; 2 HR (pD3dDevice-> CheckMultisampleQualityLevels (DXGI_FORMAT_R8G8B8A8_UNORM, 4, & msaaQuality); 3 assert (msaaQuality> 0 );
Since the quality indicator varies slightly from hardware vendor, quality depends on the expected number of samples and the texture format. in fact, what we really pay attention to is whether we support the expected number of samples. In this example, 4.