RenderKit / oidn

Intel® Open Image Denoise library
https://www.openimagedenoise.org/
Apache License 2.0
1.74k stars 160 forks source link

White splotches and brighter colors with Blender 2.83 Cycles render using the Compositor OIDN node #88

Closed franMarz closed 3 years ago

franMarz commented 3 years ago

white-splotches-1 white-splotches-2

As you can see in the first image, there are white splotches on the floor and all lamps of the ceiling are brighter, they have emission and many of them don't surpass 1 in either rgb channel.

I don't know if this issue is related to Blender, its Compositor, or OIDN.

The setup of the nodes in the Compositor is quite normal, like this: blender denoising compo

atafra commented 3 years ago

It's very hard to say what causes these issues because the result is a combination of multiple denoised images. This compositing is done by Blender, not by Open Image Denoise. To find out whether Open Image Denoise does something wrong, the inputs and outputs of each denoising node must be examined separately.

franMarz commented 3 years ago

I've been reviewing the saved passes and can't see any sign of the splotches on them, they only appear on the final image. I've reviewed other renders where this happened as well. Like here, in some parts of the roof of the following Church: Splotches-All-Saints-Church-1 Splotches-All-Saints-Church-2 Or the grass, on the left side of this image: Splotches-SRCH-1 Splotches-SRCH-2 Next, I'll try to render and use the denoiser directly, without going through the Compositor.

franMarz commented 3 years ago

Ok, there were indeed some asserts in some passes: Combined not denoised: Combined not denoised Combined denoised (white splotches): Combined denoised Environment pass not denoised (pure black): Environment pass not denoised Environment pass denoised (strange details): Environment pass denoised

The problem seems to happen during the denoising of any pass that is pure black (like "environment" in pixels which aren't part of the background) because, after using the denoising node, these passes present details that cause the white splotches to appear after the sum of several of these originally black passes. In Blender, there are information that is sent to the denoiser (albedo and normal) for better preserving detail. But I don't see anything especially strange after reviewing these passes in all cases I had, and I don't know how they interact with the base pass but, if it is pure black, I think that in no scenario any data should show up because of them.

franMarz commented 3 years ago

I'm eager to know whether this is a problem related to OIDN or I have to post it in the Blender bug tracker.

atafra commented 3 years ago

Thanks for the detailed description, it's very useful! This is indeed an issue related to OIDN but to be more specific it's related to the actual denoising algorithm that OIDN and other AI denoising libraries are using. This is not technically a bug but a limitation of the AI algorithm itself.

Which version of OIDN are you using? Recently, in v1.2.1 we alleviated this issue significantly but it's not completely gone which is unfortunately not possible with this algorithm. I highly recommend upgrading to the latest version, which might fix this issue for your use case. If the artifacts are still visible, you could try denoising the problematic passes without using the albedo and normal passes. This would completely eliminate the issue but might result in lower overall quality.

With the latest version these artifacts should not be visible when denoising final composited frames. OIDN was not trained for denoising separate passes (even if it works well in general) so such artifacts can be still visible in such cases.

franMarz commented 3 years ago

Indeed, in Blender 2.90, which uses OIDN v1.2.1, the problem seems to be solved. Combined denoised Blender 2.90: compositor denoised blender 2 9 Environment pass denoised Blender 2.90 (clean): environment denoised blender 2 9

Thank you so much for your explanation on the matter, I think I can close this issue now.

atafra commented 3 years ago

Awesome, I'm glad it works well now!