Hardware anti-sawtooth ssaa/msaa/eqaa/csaa (1) In d3d11)

Source: Internet
Author: User

In this article, we will learn how to enable the AA (anti-aliasing) function in d3d11 to improve the rendering quality and understand the principle of hardware anti-aliasing. First, let's review the concept of sampling and filtering, and then learn how to enable the AA (anti-aliasing) function in d3d11, finally, the principles of ssaa/msaa/eqaa/csaa hardware AA are described.

I. Sampling and filtering

Sampling and filter are concepts in signal processing. Sampling refers to discretization of continuous signals, and filter refers to the process of restoring original signals based on the signals after discretization.

That is, continuous signals obtain discrete signals through even sampling, and then obtain reconstructed signals through filtering. In the sampling process, the sampling frequency problem is involved. If the sampling frequency is too low, it is difficult to restore the signal through filtering. The higher the sampling frequency, the easier it is to reconstruct the recovery signal, but the higher the sampling frequency, the higher the time and space cost, this is a tradeoff problem. To ensure that the signal can be restored through filtering, the sampling frequency must be at least twice the frequency of the sampled signal, which is the famous nequest theorem. When the sampling frequency is relatively low, the recovery signal will produce the so-called "sawtooth" problem.

In computer image science, texture textures are the most commonly used for sampling and filtering. How can we sample pixel units in a texture and then use any filtering algorithm, such as nearest or linear interpolation, if the algorithm is not suitable or the texture resolution is too low, the problem may occur.

Another problem related to the Sawtooth is that, when a raster object is made, the object's edges may produce the Sawtooth problem. As shown in:

The essence of this problem is that the screen space is represented by discrete pixels, and the discrete sampling points are used to represent continuous object shapes, which will inevitably result in the problem of sawtooth. Note: In the screen space, we usually use point sampling. The center of the pixel is the position of the sampling point.

2. Enable the hardware AA function in d3d11

In d3d11, we set the dxgi_sample_desc In the switching chain and deep template buffer to enable the hardware anti-sawtooth function.

Typedef struct dxgi_sample_desc

{Uint count;

Uint quality ;}

Dxgi_sample_desc, * lpdxgi_sample_desc;

There are two parameters. Count specifies the number of samples per pixel. The maximum value is 16. Quality is used to specify the quality of AA. This is related to the hardware manufacturer. Generally, if the count and quality values are the same, the hardware calls the msaa anti-sawtooth function, while the Count value is small, while the quality value is large, for example, Count = 4, and quality = 8, generally, amd graphics cards call eqaa hardware anti-aliasing, while NV graphics cards call csaa hardware anti-aliasing.

We can use functions

Id3d11device: checkmultisamplequalitylevels (dxgi_format format, uint samplecount, uint * pnumqualitylevels );

To obtain the range of quality under a certain number of samples. For example, if the result is 16, the valid value of quality is [0-15].

References:

Http://www.cnblogs.com/gongminmin/archive/2011/05/16/2047506.html

Http://graphics.stanford.edu/courses/cs248-07/lectures/2007.10.11%20CS248-06%20Multisample%20Antialiasing/2007.10.11%20CS248-06%20Multisample%20Antialiasing.ppt

Http://www.geeks3d.com/20110915/amd-eqaa-modes-enhanced-quality-anti-aliasing-for-radeon-hd-6900-series/

Http://www.tomshardware.com/reviews/anti-aliasing-nvidia-geforce-amd-radeon,2868-4.html

Http://www.nvidia.com/object/coverage-sampled-aa.html

Http://en.wikipedia.org/wiki/Supersampling

Http://www.confettispecialfx.com/multisample-anti-aliasing

Real-time rendering 3rd

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.