Skip to content

giaosame/Project4-CUDA-Denoiser

 
 

Repository files navigation

CUDA Denoiser For CUDA Path Tracer

University of Pennsylvania, CIS 565: GPU Programming and Architecture, Project 4

  • Qiaosen Chen
  • Tested on: Windows 10, i5-9400 @ 2.90GHz 16GB, GeForce RTX 2060 6GB (personal computer).

Features

  • A Trous Denoiser
  • Gaussian Filter (extra credit)

Denoised Results

Performance Analysis

The extra time denoising adds to the renders

cornell cornell_ceiling_light cornell_glassball cornell_mjolnir
denoised_cornell ./img/denoised_cornell_ceiling_light denoised_cornell_glassball denoised_cornell_mjolnir

Running Time of 100 Iterations between Render with and without Denoiser

As we can see from the above table, the render with denoiser actually takes a little bit more time to run 100 iterations than the render without denoiser. It's reasonable to spend more time to run extra 3 iteration to compute the A Trous filtering, but the difference in running time is very small, so the Edge-Avoiding A-Trous Wavelet Transform algorithm is very efficient.

The influences of denoiser on the number of iterations

cornell with Denoiser Using 100 Iters cornell with Denoiser Using 300 Iters cornell without Denoiser Using 1000 Iters
cornell with Denoiser Using 100 Iters cornell with Denoiser Using 300 Iters cornell without Denoiser Using 1000 Iters
cornell_glassball with Denoiser Using 100 Iters cornell_glassball with Denoiser Using 300 Iters cornell_glassball without Denoiser Using 1000 Iters
cornell_glassball with Denoiser Using 100 Iters cornell_glassball with Denoiser Using 300 Iters cornell_glassball without Denoiser Using 1000 Iters

As the project Introduction pointing out, "acceptably smooth" is subjective. So I choose the images without being denoised as the evaluation standard, although there still exists some noise in those image after 1000 iteration. There are still a lot of blurred area can be seen in the denoised images after 100 iterations. Comparing with the above 2 groups of images, I think the denoised images output by the render after 300 iterations have the best performance and they show the "acceptably smooth" results. Thus, in my point of view, the render with denoiser can take less 70% of iterations than the original render to get smooth output.

The influences of denoiser on the runtime at different resolutions

Running Time of 100 Iterations at Different Resolutions

Apparently, larger resolution means more running time. From the above char, we know that denoiser almost doesn't have any influences on the runtime at different resolutions.

Effectiveness of denoiser on the different materials

cornell_diff_mats with Denoiser Using 100 Iters cornell_diff_mats with Denoiser Using 300 Iters cornell_diff_mats without Denoiser Using 1000 Iters
cornell_diff_mats_denoised_100iters cornell_diff_mats_denoised_300iters cornell_diff_mats_1000iters

The denoiser has a great performance on those materials showing a smooth surface, such as specular material and glass material, even the rendered images after running the program 100 iterations shows the "acceptably smooth" surfaces. However, the denoiser doesn't do a good job on the soft shadows on the diffuse material, if the number of iterations is not large enough. Because the filter will blur the surrounding pixels, the soft-shadow effect will also be blurred so that a gradual stratification of shadow cannot be seen very clearly, at this situation, running the denoiser with more iterations, such as 300 iterations, can improve the soft-shadow effect greatly.

cornell_mjolnir_diff_mat

However, the smoothing effect brought by denoiser is absolutely a disaster for materials with texture mapping. The details of textures will be blurred so that no interesting texture details can be seen from the denoised images.

Visual results and performance for varying filter sizes

1 x 1 5 x 5 17 x 17
Denoiser with 1x1 filter Denoiser with 5x5 filter Denoiser with 17x17 filter
33 x 33 65 x 65 129 x 129
Denoiser with 33x33 filter Denoiser with 65x65 filter Denoiser with 129x129 filter

If the filter size is small, for example less than 17 x 17, i.e., use fewer than 3 iterations to call the edge stopping function, the denoising is not effective, the images are still filled with grains, because of the small blurred area. Comparing the usual filter size 17 x 17, those images denoised with larger filter size don't show a great improvement, and from the following chart we can know that the difference in filter size don't have an impact on running time, so it's feasible and reasonable to choose 17 x 17 as the A Trous filter size.

Runtime of Varying Filter Sizes Rendered in the Basic Cornell Scene

A-Trous filtering and Gaussian filtering Comparison

A-Trous Filtering Result Gaussian Filtering Result
A-Trous Filtering Result Gaussian Filtering Result
A-Trous Filtering Result of cornell_ceiling_light Gaussian Filtering Result of denoised_cornell_ceilling_light
A-Trous Filtering Result of cornell_glassball Gaussian Filtering Result of cornell_glassball

A-Trous filtering and Gaussian filtering Comparison in Runtime

I implemented the basic Gaussian filtering with kernel size 17 x 17 and $\sigma$ = 15, which just simply blurs the image, as we can see. The Gaussian filtering only outputs a blurred images without details and take a little bit more time than A-Trous filtering, so A-Trous definitely outperforms Gaussian filtering.

References

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 84.2%
  • C 13.5%
  • Cuda 1.7%
  • Other 0.6%