Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 50 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,56 @@ CUDA Denoiser For CUDA Path Tracer

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

* (TODO) YOUR NAME HERE
* Tested on: (TODO) Windows 22, i7-2222 @ 2.22GHz 22GB, GTX 222 222MB (Moore 2222 Lab)
* Yiyang Chen
* [LinkedIn](https://www.linkedin.com/in/yiyang-chen-6a7641210/), [personal website](https://cyy0915.github.io/)
* Tested on: Windows 10, i5-8700k @ 3.7GHz, GTX 1080, personal computer

### (TODO: Your README)
### Gbuffer visualize

*DO NOT* leave the README to the last minute! It is a crucial part of the
project, and we will not be able to grade you without a good README.
| normal | position | time-of-flight |
|---|---|---|
|![](img/gbuffer_normal.png)|![](img/gbuffer_pos.png)|![](img/gbuffer_t.png)|

### Denoise result

| no denoise | naive denoise | edge-avoiding denoise |
|---|---|---|
|![](img/no.png)|![](img/naive.png)|![](img/edgeAvoiding.png)|


P.S. the filter size of the 2 denoise images is 2, and color weight 0.45, normal weight 0.35, position weight 0.2

### Performance analysis

* how much time denoising adds to your renders

* Rendering takes about 26000 microseconds and denoising takes only about 5 microseconds when the filter size is 10, which is very fast.

* how denoising influences the number of iterations needed to get an "acceptably smooth" result

![](img/number_of_iteration.png)
| no denoise (100 iterations) | denoise (20 iterations) |
|---|---|
|![](img/100.png)|![](img/20.png)|

The above 2 images are a little different, but I think they are all smooth enough.

* how varying filter sizes affect performance
* The time increases when filter size becomes larger.
![](img/filtersize.png)

* how visual results vary with filter size -- does the visual quality scale uniformly with filter size?

* I found that filter size 1 is much more smooth than filter size 0 (no denoise), and when filter size is 1, 2, 4, 8, I can see the visual quality improves a little. However, when filter size is larger than 10, the visual quality seems almost the same. I think it's because the weight of the far pixel is very small.

* how effective/ineffective is this method with different material types

* I think it's effective with the material that has no texture map or the color is almost the same. Because if the color change quickly in space with similar normal and position, the denoise function may blur the material a little.

* how do results compare across different scenes - for example, between cornell.txt and cornell_ceiling_light.txt. Does one scene produce better denoised results? Why or why not?

* cornell_ceiling_light.txt produce better denoise results than cornell.txt in 10 iteration. I think it's because of the size of light, that is to say, a big light makes the rendering converge faster, so the denoise result is also better.

| cornell (10 iterations) | cornell_ceiling_light (10 iterations) |
|---|---|
|![](img/cornell.png)|![](img/edgeAvoiding.png)|
Binary file added img/100.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/20.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/cornell.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/edgeAvoiding.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/filtersize.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/gbuffer_normal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/gbuffer_pos.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/gbuffer_t.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/naive.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/no.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/number_of_iteration.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion scenes/cornell.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ EMITTANCE 0
CAMERA
RES 800 800
FOVY 45
ITERATIONS 5000
ITERATIONS 10
DEPTH 8
FILE cornell
EYE 0.0 5 10.5
Expand Down
2 changes: 1 addition & 1 deletion scenes/cornell_ceiling_light.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ EMITTANCE 0
CAMERA
RES 800 800
FOVY 45
ITERATIONS 10
ITERATIONS 20
DEPTH 8
FILE cornell
EYE 0.0 5 10.5
Expand Down
148 changes: 148 additions & 0 deletions scenes/my_cornell.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
// Emissive material (light)
MATERIAL 0
RGB 1 1 1
SPECEX 0
SPECRGB 0 0 0
REFL 0
REFR 0
REFRIOR 0
EMITTANCE 5

// Diffuse white
MATERIAL 1
RGB .98 .98 .98
SPECEX 0
SPECRGB 0 0 0
REFL 0
REFR 0
REFRIOR 0
EMITTANCE 0

// Diffuse red
MATERIAL 2
RGB .85 .35 .35
SPECEX 0
SPECRGB 0 0 0
REFL 0
REFR 0
REFRIOR 0
EMITTANCE 0

// Diffuse green
MATERIAL 3
RGB .35 .85 .35
SPECEX 0
SPECRGB 0 0 0
REFL 0
REFR 0
REFRIOR 0
EMITTANCE 0

// Specular white 1
MATERIAL 4
RGB .98 .98 .98
SPECEX 0
SPECRGB .98 .98 .98
REFL 1
REFR 0
REFRIOR 0
EMITTANCE 0

// Specular white 2
MATERIAL 5
RGB .98 .98 .98
SPECEX 0
SPECRGB .98 .98 .98
REFL 0.5
REFR 0
REFRIOR 0
EMITTANCE 0

// Specular white 3
MATERIAL 6
RGB .98 .98 .98
SPECEX 0
SPECRGB .98 .98 .98
REFL 1
REFR 1
REFRIOR 1.5
EMITTANCE 0
REFRRGB .98 .98 .98

// Camera
CAMERA
RES 800 800
FOVY 45
ITERATIONS 10
DEPTH 8
FILE cornell
EYE 0.0 5 10.5
LOOKAT 0 5 0
UP 0 1 0
LENS 0.025
FOCAL 10


// Ceiling light
OBJECT 0
cube
material 0
TRANS 0 10 0
ROTAT 0 0 0
SCALE 3 .3 3

// Floor
OBJECT 1
cube
material 1
TRANS 0 0 0
ROTAT 0 0 0
SCALE 10 .01 10

// Ceiling
OBJECT 2
cube
material 1
TRANS 0 10 0
ROTAT 0 0 90
SCALE .01 10 10

// Back wall
OBJECT 3
cube
material 1
TRANS 0 5 -5
ROTAT 0 90 0
SCALE .01 10 10

// Left wall
OBJECT 4
cube
material 2
TRANS -5 5 0
ROTAT 0 0 0
SCALE .01 10 10

// Right wall
OBJECT 5
cube
material 3
TRANS 5 5 0
ROTAT 0 0 0
SCALE .01 10 10

// Sphere 1
OBJECT 6
sphere
material 4
TRANS -3 2 -1
ROTAT 0 0 0
SCALE 3 3 3

// Sphere 2
OBJECT 7
sphere
material 5
TRANS 0 4 -1
ROTAT 0 0 0
SCALE 3 3 3
3 changes: 3 additions & 0 deletions src/denoise.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#pragma once


Loading