I recently posted about a denoising algorithm I was working on. The initial post can be read here.
In an effort to try and reduce render times, I came across papers talking about how other production render engines are using some denoising techniques to limit the number of passes required to make a cleaner render. Part of ray-cast engines is that, while they are very good at replicating real world lighting, they also produce a lot of noise. This comes down to some randomness in the way rays are 'coloured' from sampling at different locations around the virtual world and surfaces.
Initially, I couldn't get my denoiser to work. The images kept coming out blurry. Then I realised I was basing my denoiser off 8-bit RGB, but sending it floating point values. So I adjusted this, and now I can see some success.
Below is an older render, one I did quite sometime ago. There's a second version of this image in there as well, which has been run through the denoiser. It has a slider you can drag left and right to view the two images. If you look carefully in the original image, there's some noise in the glass sphere and in some of the shadows in the foreground. Now, if you drag the slider back and forth, you'll see the noise pattern does seem to suppress a little in the updated and denoised image.
One thing I did notice, is that we do seem to lose a little detail in the join between the side walls and the floor. If you look at the join area and drag the comparison slider over them a few times, you can spot the join shadow disappearing a little. I don't know if this will be an issue in other places later on.
So, we got a denoiser working! Now the question comes down to, what parameters work best, and at what stage should I be using it. The example image above is with 1000 passes. So maybe that's a reasonable benchmark to work from. I suspect, as has been mentioned in some of the papers I read, that it will be best used at some point at the end where we begin to get diminishing returns on our overall render passes. This does seem to kick in somewhere around the 1000 passes in my engine. Having said that, the render above is only using a 1x1 subsampling. So this will affect the number of render passes if we crank this up more.
I must admit, I'm not sure I'm completely comfortable with denoising renders. People see noise in animations so it's worthwhile limiting the noise where you can, it's a noticeable artifact. But having something denoise your image artificially when it may not have any idea of other images in a sequence (ala animation), has me wondering if this is the right way to go. Maybe I need to expand on it to compare other frames in animation sequences. Further down the track when the engine starts to produce some animation, will probably be when this starts to become more important.
For now though, it won't do any harm to have the code and functionality there. If nothing else, it can be a user-selectable option, if need be.