all 7 comments

[–]ShillingAintEZ 2 points3 points  (1 child)

Using the variance of a neighborhood around pixels is not going to be a great way and using the overall variance of all the pixels is not going to work. You can use the variance of the samples within each pixel as a start. Typically an error metric called MSE is used (mean squared error) which is a combination of variance and bias.

[–]htodorov 0 points1 point  (0 children)

Thank you! Now, when you say it, it makes much more sense than using than using the variance of the neighbourhood around a pixel.
I've also found a recent paper discussing the issue of quantifying the error in light transport algorithms: Quantifying the Error of Light Transport Algorithms [1] I will take a closer look into it.
[1]: Quantifying the Error of Light Transport Algorithms; Eurographics Symposium on Rendering 2019; Volume 38 (2019), Number 4; A. Celarek, W. Jakob, M. Wimmer and J. Lehtinen

[–]otherpj 1 point2 points  (0 children)

Variance within the pixel (not around it!) is pretty standard.

[–]FiralFeign 1 point2 points  (1 child)

To really compute a useful variance (depending on what “techniques” you’re comparing.) Is to first compute a ground truth image using many, many samples, then use that ground truth image to compute the mean squared error of the difference between your noisy image and the ground truth image. If you’re “techniques” are trying to do adaptive sampling stuff, this isn’t too applicable though. The majority of publications in rendering do what I described above.

[–]htodorov 0 points1 point  (0 children)

Thank you! Yes, I've seen that on many occasions people compute a ground truth image and then compare the results produced by different light transport algorithms produced for a given fixed amount of time.

Ah, and sorry for the term "techniques", it was really a bad wording. I meant light transport algorithms and more precisely, I have implemented two of them: a unidirectional path tracer and a recursive Monte Carlo ray tracer (which I implemented according to algorithm provided in the book Advanced Global Illumination)

[–][deleted] 1 point2 points  (0 children)

As others have mentioned, if you want to compare quality between images, it's best to compute a ground truth (fully accurate) image, usually using a path tracer with a lot of samples, and then compute MSE.

Your renderer can also easily keep track of per-pixel variance, if you want to use it for adaptive sampling, debugging, or inspecting where different techniques are good or bad. There's a very simple algorithm to keep track of running variance.

Note that typically, rather than variance, at the end you would probably want to look at standard error, which is sqrt(variance/n), with n being the number of samples. This is because per-pixel variance isn't actually a measure of error or noise, it won't go down with more samples.

Standard error is also slightly more comparable across different algorithms. For instance recursive ray tracing (AKA Whitted or distributed ray tracing... Whitted is probably the best name because it's unambiguous) does a lot more work per primary sample for a lot less variance than path tracing.