API for checking Hardware Multi-sampling capability with multi-sampling and dx11

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.