Gerardo Estrada - DPont Denoiser
plugin by Denis Pontonnier
Part 2
The common usage is apply the Denoiser filter in the final color pass and this is the reason why textures may be blurred too. In order to solve this, we apply the filter in the lighting pass instead (you can read more about the lighting pass
here). This pass contains the direct and indirect diffuse illumination but without colors or textures:
Just diffuse lighting, which where we need DP Denoiser to work at:
Notice the Normals drives the ReferenceColor parameter, this was recommended by Denis since it helps the Sigma parameter to recognize the edges of the surfaces. Depth drives the ReferenceAlpha and in this case, the illumination pass drives the Alpha, which helps the filter to respect the details in shadowing areas. Passes for the illumination pass might vary from about 5 to 30 by depending on the level of noise. Less passes/samples in lights/shading, faster render times and need higher Blur Passes Number in DP Denoiser. After that, we integrate back the textures by multiplying the Raw Color buffer back to the Diffuse Shading:
Additionally, if you have noisy blurred reflections too:
you might want to try same setup for Shaded Reflection. Commonly, less passes are necessary and a wider threshold may be used (higher Sigma values):
If samples are very low (like in this case) and contrast ratios are extremely high (like is also in this case) you might want to limit a bit the luminance values for this pass.
Therefore, we can mix the Shaded Diffuse buffer with the Shaded Reflection buffer (addition):
And later the Shaded Refraction Buffer (additive too):
If you have a scattering buffer you have to add it too (and filter it here if it's noisy) by using DP Extra BUffers (SSS/SSS2/Skin Materials/Chanlum) or Global Buffers (Chanlum).
Additionally in this case I've added a vignetting effect with DP Vignetting:
And the Filmic TMO, plus DP DOF and DP Bloom:
Good thing about DP Denoiser is that it's applied consistently in every frame. This particular setup is suitable for outdoors only. You can play with the settings and if you find a better setup, do not hesitate to share it here
Thanks again to Denis Pontonnier for such useful tools!
Gerardo