University of Pennsylvania, CIS 565: GPU Programming and Architecture, Project 4
-
Alex Fu
Tested on: Windows 10, i7-10750H @ 2.60GHz, 16GB, GTX 3060 6GB
A real-time path tracing denoiser. Reference: Spatiotemporal variance-guided filtering: real-time reconstruction for path-traced global illumination.
feature.mp4
In order to better represent the geometries of reflection, I blend the geometries according to material types:
Diffuse material:
-
Albedo buffer: store first bounce albedo
-
Normal buffer: store first bounce normal
-
Depth buffer: store first bounce depth
Glossy Material:
-
Albedo buffer: blend the first and second bounce albedo
-
Normal buffer: store first bounce normal
-
Depth buffer: store first bounce depth
Specular Material:
-
Albedo buffer: blend the albedo until hits non-specular material
-
Normal buffer: store the first non-specular material's normal
-
Dpeth buffer: accumulate the depth until hits non-specular material
This denoiser is based on SVGF so there is another buffer storing the square luma.
The square luma is calculated by:
Also notice that the final albedo buffer is the blend of all spp's albedo buffer.
The denoiser is essentially a bilateral wavelet filter. Its weight can be denoted by:
where
Where the luminance
The deviation
where
In practice, the filter size is 5X5,
To stabilize the preview, the GUI will blend the last result and the current result.
wavelet filter | gaussian filter |
---|---|
![]() |
![]() |
The results of wavelet filter and gaussian filter look similar. However, the computation of wavelet filter is less.
As shown in the demonstration video, it took 64 iterations for generating a plausible result for an inner scene.
By introducing the luminance weight, the filter will be aware of the edges between light and dark, thus better preserving the edges of shadows and light sources.
Also, introducing the deviation term further improves the edge preservation and can decrease the blurring as the rendering result converges. With more and more samples, the
By adding dilations, wavelet filters can a have larger reception field than normal filters with similar computational costs.
5x5 wavelet filter, 4 times, 4.96ms | 9x9 normal filter, 5ms |
---|---|
![]() |
![]() |
At the same time cost, the wavelet filter generates better result.
9x9 wavelet filter, 4 times, 18.5ms | 7x7 wavelet filter, 4 times, 10.9ms |
---|---|
![]() |
![]() |
5x5 wavelet filter, 4 times, 4.96ms | 3x3 wavelet filter, 4 times, 2ms |
---|---|
![]() |
![]() |