Filtering and MIP map Introduction

Source: Internet
Author: User

Ping-che Chen

Directory:
Part 1
Part 2
Part 3
Part 4

Document Content:
[Part 1]

In the previous fsaa introduction, the triangular surface distortion (Aliasing) Question. However, in this article, the main method mentioned is to eliminate the aliasing (usually just getting the current image) of the Triangle Plane, I have not mentioned the issue of zookeeper. In this article, we will introduce the problem of distortion of dynamic route and the methods currently used by 3D acceleration chips.

What is the difference between the distortion problem of linear regression and the distortion problem of the general triangular plane? The most important difference is thatTry again(Resampling. The reason is that the camera itself is also a digital image. Therefore, the response is already taken as a result by a response. Now, we need to adjust the cursor to the triangle. The points required by the triangle are not necessarily the same as those used by the triangle. Therefore, there will be a second case. The following example is an example:

In the upper half, the white lattice on the left is opposite to the image on the screen, so we can regard it as a enlarged image. The right pane is the enlarged image points for the left pane. Therefore, we can see that when a watermark is placed on a 3D triangle, its image points will change significantly. In addition, because of transparent projection, the same distance is not necessarily fixed. This will make the problem more difficult.

Labels:This notebook is produced by the show footprint program provided by NVIDIA.

If you only look at the processing duration of 1d, then, the same process will be taken again, as shown in the following example:

During the same process, Zookeeper has two main problems: the first is to zoom in, that is, to take the distance of the same point, it is smaller than the time range of the original snapshot. The second is the time range of the snapshot. The preceding example is an example of amplification.

[Part 2]

The first operation to be retained is to reconstruct the original response. If the re-creation operation is incorrect, the problem will be distorted when the operation is correct. According to the processing principle, we know that after the same operation, as long as the same operation rate is greater than twice the actual operation rate (that isNyquest frequency. This is often used in many regions, including audio processing domains. What is the case when the data is in the dense shape? The following is an example:

Original zookeeper Recreate snapshot (use 60x60 SINC filter)

We can see that the reconstructed aggregate has a very heavy ringing effect. This is the result of two consecutive attempts to avoid. However, using this method to reconstruct a replica set does not have a serious problem with aliasing. However, using this method to reconstruct the workload is unlikely to be implemented immediately because the computing workload is too large. In the above example, we use the SINC filter of 60x60. Therefore, we need to calculate 60x60 for each retrieved point. The calculation volume is very large.

In addition to the problem of re-constructing a replica set, if the re-image is a small one, that is, the distance between the same point becomes larger, an external mechanism for removing high-risk ingredients is also required. This part is more complex than others, so here we will first zoom in and try again as the main.

In order to be able to quickly reconstruct the zookeeper, you must use a simple calculation. The simplest operation, of course, is to directly retrieve the nearest operation point when the same operation is performed. Therefore, this method assumes thatNearest sampling. Because only one sampling point is usedPoint sampling. However, it may not be too good, and it will produce new distortion issues.

In fact, point sampling can also be seen as a method to use the zero-time multi-linear (I .e., the constant-number multi-linear) approximation. Therefore, a natural idea is to use a multi-layered approach, that isImplicit content insertion(Linear interpolation). The following example shows the implicit inner:

If it is in a two-dimensional environment (such as a 2D internal environment), it is necessary to perform an internal plug-in for both directions at the same time.Implicit inserting(Bilinear interpolation).

When using implicit interpolation, each sampling point requires 2x2 points for calculation, so the computing volume is not large. However, the implicit interpolation problem is that the results produced by it are not smooth, so in some cases, the table is not good. For example, in the lower-right corner of the letter D in the example below, the result generated by inserting the letter D in an implicit manner is still the appearance of some animated images.

If we increase the approximate number of times, we will approach it in the three-plus formula.Cubic Interpolation. In the case of binary regressionBicubic interpolation. There are many different types of three-time insertion. However, for each point, it requires a 4x4 calculation. In terms of the current 3D hardware, the computing volume is already quite large, so few 3D hardware instances support this plug-in method. However, the three plug-ins will produce a series of slides, so in general, the effect is better than the implicit plug-in.

The following is an example of point sampling, bilinear interpolation, and bicubic interpolation.

Point sampling Bilinear interpolation Bicubic interpolation

Generally, because the bilinear interpolation effect is relatively good, and the computing workload is small, therefore, generally, the 3D display chip uses bilinear interpolation to handle the replaying problem of compaction, especially in the enlarged part.

[Part 3]

If the time for getting the same image again is larger than the original time range, that is, when the image is small, there will be a new problem. The most explicit problem is that when the same point distance is zoomed in, the same response rate is reduced. At this time, the memory may contain some excessively high rate components. Therefore, a low pass filter is required at this time. The following is a typical example:

Original shard Point sampling 3 × 3 Gaussian filter Adaptive Filter

In the above example, the original shape has a relatively high sampling rate, but it does not exceed half of the sampling rate, so there is no such phenomenon. However, if you directly perform the same operation again, then when it is half the original time, it will produce a distorted image. We can see that none of the original shapes appear in the three corners outside the upper left corner. If you use a 3 × 3 Gaussian filter and perform the same operation again, the situation will be better, and the shape will become unknown. If adaptive box filter is used, the distortion is almost invisible. However, in general, it will be blurred.

In fact, in general, the effect of Simple Box Filter is quite good. In fact, it is impossible to find a "useful" filter. If a filter can eliminate distortion, it is usually blurred. Conversely, if a filter produces a clear result, it usually cannot effectively eliminate distortion. Therefore, what filters should be used is often related to the shape itself.

However, it is unlikely that these filters will be used if it is time-based. Because the larger the limit, the larger the filter is. For example, the box filter with a latency of 2x2 can have a good effect. However, if it is 4 times smaller than the limit, a 4 × 4 Box Filter is required. This is a very troublesome problem for real-time computing.

To understand this issue, Lance William proposed an important article "pyramidal parametrics" in ACM Siggraph in 1983 ". In this article, we propose a solution: If we use filters of different sizes to process these filters in advance, we can create many different sizes of filters. In the future, as long as you select the desired shard size, you do not need to use a filter over 2x2. This method is MIP map. MIP is LatinMultum in parvo(That is, when things in a small place.

For example, if the memory size is 256 × 256, you can calculate 128 × 128, 64 × 64, 32 × 32 ,... , 4x4, 2x2, and 1x1 of the. Currently, the pseudo-devices must be retained on the primary node, which is five times smaller than the primary node. In this case, you only need to use the 64 × 64 version to quickly obtain the same result, instead, you do not need to perform a 5 × 5 filter on the original shard. Of course, this will increase the space required by zookeeper, but it will only increase the original space by 1/3 at most. The speed of the test is not much.

However, even using MIP map cannot solve all problems. MIP map must be used in combination with the filters to produce a better result in some cases.

[Part 4]

Now let's look at some examples of MIP map. The hypothetical router has three equal standards, as shown in the following figure:

Now, put one path between the nearest, middle, and nearest neighbors. If only common bilinear filtering is used, the result is as follows:

The first path is clear, but the last two paths become worse. For example, if the path is white, only a part is shown in the subsequent two paths. If MIP map is used, the result will be better:

However, if you select only the resolution of a certain MIP map for each pixel, some problems may occur. Here we use a "path" as an example:

A path is shown in the upper limit. It does not use MIP map, so we can see that the color skew mark on the left side is out of a certain distance, and some distorted images will appear. If MIP map is added, the result is as follows:

You may say, "Wow! What is this !」. Obviously, it shows a blurred image. More than that, we can also see that the operator is too busy. This is because different time ranges require different resolution levels. However, when the resolution is fixed, the response is not smooth, so it is possible.

This problem does not solve the problem. You only need to write an internal plug-in between two resolutions. This is whatTrilinear Filtering. The result is as follows:

It can be seen that after trilinear filtering is used, there will still be a blurred image, but at least it will be lost.

Why is the image blurred? This is because this road is "flat" for the observer. Therefore, the footprint of a pixel on the pixel kernel will become very flat. For example, it may be a square with a length ratio of or greater. A low resolution is selected when the chip determines which resolution of MIP map to use. Therefore, it will cause the resolution to be accurate in a certain direction, but it will be blurred in another direction. In terms of the above, the resolution in the vertical direction is valid, but the horizontal direction is not valid.

A simple method can solve this problem. We can immediately show that the chip uses a high-resolution middleware. For example, if we know that footprint is usually around, then we can use four-fold resolution for the program. This is the MIIT bias of MIP map. The following are two examples:

SlS bias =-1.0 SlS bias =-1.5

From the results above, we can see that setting the level of detail (SLD) bias can improve the blurred image. However, it also causes distortion. It can be noted that the gradient color on the left side is skewed, and there are some distortion.

Therefore, it cannot solve all the problems, and it can only be used in some specific situations. However, there is another way to handle this situation. If we already know that the footprint of a certain segment is always very flat, and we know that it is usually flat to a certain extent (for example ), in fact, it can be a very flat hacker from the beginning. This is especially effective for running lanes such as a taxi. The following example shows the result after of the road surface length:

It works well. However, this method can only be used in a fixed direction. If the direction is often dynamic, it may become more fuzzy. Of course, it is very difficult to deal with general traffic changes, such as general traffic jams. However, this method is not so useful in terms of changes in the direction of attention such as the first shot, and the line-based model. The following example is an example:

It is still relatively vague in the operator's fuzzy situation, and there is no clear over-degree fuzzy phenomenon. However, when the distance is near, especially when the color is oblique, it gets blurred. Therefore, it is not a method used by developers.

The ideal practice is to use more Texel for filtering. For example, if footprint is a 2-1 long square, take eight texels for filtering. As shown in the following example:

In the upper section, the highlighted and highlighted boxes are the footprint of the two pixel pairs. The length ratio of the bright colored box is not big. It only contains four texels, so the general bilinear filtering is used. But the bright color box is different. Its length ratio is about 2 to 1, and eight texels are included. Therefore, regular bilinear filtering will be used to select lower-resolution linear regression. Therefore, it will calculate the average of the texels in the margin boxes close to the gray boxes, so it will produce a blurred image.

To avoid the blurred image, the simplest method is to take the eight texels it contains for average. Of course, this requires a larger computing volume than bilinear filtering. Because this practice is usually required only when the growth ratio is greater than 1Anisotropic Filtering.

Of course, generally, the hardware of the wafer cannot be obtained without restrictions. For example, a hardware instance may only support access to eight texels (16 for trilinear ). In addition, because the longer the limit ratio is, the more texels the longer the limit, the higher the average number of texels. This may also affect the performance. Therefore, we usually specify the maximum length-to-growth ratio. That is to say, the display chip only needs to handle the growth ratio to a certain degree, such. If the number is longer than this number, it will have to be blurred. This number is usually equivalentMaximum level of anisotropy.

The lower limit sets the maximum length ratio to 2:

Because it only deals with the case where the ratio of length to 2: 1, it is exactly the same for the case where the vertices are over-fuzzy. However, unlike paid, it does not produce distortion on the Color oblique mark.

The following example sets the maximum length ratio to 16:

We can see that all the distortion, including the blurred current image, has disappeared. In this case, it is possible to produce a very high quality marketing effect. However, its shortcomings are also very clear: for each batch, when trilinear filtering is used, a maximum of 128 texels are required. This requires a lot of manual operations on the memory, which may reduce the performance. Moreover, not all render chips support such high anisotropic filtering. For example, NVIDIA's geforce 256 and geforce 2 series display chips only support anisotropic filtering with a growth ratio of 2.

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.