Real-time noise reduction in Unity3d games-Research and Implementation of Square Enix documentation, unity3denix

Source: Internet
Author: User

Real-time noise reduction in Unity3d games-Research and Implementation of Square Enix documentation, unity3denix
Let's take a look at the SE Technical Documentation's decision on noise reduction,
This test scenario:


The article mentions three main filtering methods. There are three methods in the last method.
Conventional geometry-aware implements ltering, Distribution-Aware Filtering, Specular Lobe-Aware Filtering and Upsampling
According to the formula, I did not know whether the noise removal method was correct, although the effect was =;

Steps:
1. Find out the noise wave (including the noise wave and texture details)
2. Calculate the specular and diffuse interference.
3. There are many methods here: a. Use other pixels to replace the noise wave B. Calculate the average value of surrounding sampling (Fuzzy )....

Conventional geometry-aware extends ltering based on the most basic Gaussian filter,

This method requires calculation of the depth and normal, which can be obtained by obtaining _ CameraDepthTexture and _ CameraNormalsTexture. For details, see


W is equivalent to determining the correctness of filtering, because the edge of an object may be mistaken as a noise, resulting in rough or fuzzy edges.

W weight formula
 
 

float wk = Gaussian(GetDepth(i_) - GetDepth(j), _Sigma_z);


Si is the position of the screen space point in pixel I.
G is a Gaussian function.

 



σ is the standard deviation of Gaussian distribution


inlinefloat Gaussian(float x, float y){return _A * exp(-(((pow((x - _X0), 2)) / (2 * _Sigma_x *_Sigma_x)) +((pow((y - _Y0), 2)) / (2 * _Sigma_y *_Sigma_y))));}



W result Graph
 

The edge is clearly visible, because it is determined by depth and normal, so there is no noise, but also covers details such as diffuse. Through w, we can reduce the noise reduction on the edge.

Then compare the gray scale by sampling. If there is too much difference between the current point and the sampling point, it is the noise wave. The more sampling points, the more accurate it is.

We can clearly find the role of w.



Results)

Zoom in results




Distribution-Aware Filtering is used to determine and sharpen the noise wave to facilitate noise recognition.

 
 
T2 is a custom Parameter
Ci is smooth distribution

Function B is an arbitrary smoothing kernel.
For example:
Gaussian filter Gaussian fi ltering
Anisotropic fi ltering
Total Variation minimization
Neighborhood neighboring ltering
NL-means algorithm
And so on.
Here, the blogger uses Gaussian filter.





The result of W is as follows:
 
The noise is not enabled, but the w in this method contains the noise, so we cannot use w to judge the cut off,
Here, w is the first function, that is, to judge the noise. However, the input parameter β of this method, you can adjust the filtering degree of the highlight and shadow parts (you can see that the specular area in the figure is completely black, but it is not filtered at this time, and the difference between the sampling points is 0 ), therefore, this method does not need to be cut off.

The result is as follows:



Higher fidelity than the image details of the previous method (see lena), and the loss of details such as highlights is almost 0


Implementation result in SE document
 




Specular Lobe-Aware Filtering and Upsampling enhances the Filtering correctness judgment, and adds the judgment on the highlight, avoiding misjudgment on the edge of the highlight.

 
float ai = v * max(dot(N, lightDir), 0);




The result of W is as follows:
 
Added the judgment on the details of the High-light and dark parts, so that the noise reduction effect on the highlights is good.



The best of the three methods


The result is as follows:




Implementation result in SE document




Comparison of Three Methods



Code uploaded to github

------ By wolf96 http://blog.csdn.net/wolf96

 
 

Related Article

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.