Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project 4: Shenyue Chen #22

Open
wants to merge 8 commits into
base: base-code
Choose a base branch
from
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
6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"files.associations": {
"*.js ": "javascript",
"iostream": "cpp"
}
}
50 changes: 45 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,51 @@ 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)
* Shenyue Chen
* [LinkedIn](https://www.linkedin.com/in/shenyue-chen-5b2728119/), [personal website](http://github.com/EvsChen)
* Tested on: Windows 10, Intel Xeon Platinum 8259CL @ 2.50GHz 16GB, Tesla T4 (AWS g4dn-xlarge)

### (TODO: Your README)

*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.
## Performance analysis

### Render time
For the cornell box scene, we measure the average time per iteration, which is quite stable, around 0.11s per iteration.
<p align="center">
<img src="./result/render_time.png" />
</p>

### Denoise time
To analyze the time used to denoise, first we consider the image of 800 * 800 resolution, we change the number of filter levels. We could observe that the time needed to denoise increases for the first levels but remain stable when the stepwidth gets too big, which is expected. Compare the denoise time with the render timer per iteration we get from the previous section. The denoise time is roughly equal to one iteration for the cornell box scene.
<p align="center">
<img src="./result/denoise_time.png" />
</p>

#### Denoise performance for different levels
We can observe the denoise performance for different levels under the same cornell scene. The result clearly gets better as the number of filter levels grow.
<p align="center">
<span>200 iter 1 filter levels</span>
<img src="./result/200samp.1filter.png" />
</p>
<p align="center">
<span>200 iter 3 filter levels</span>
<img src="./result/200samp.3filter.png" />
</p>
<p align="center">
<span>200 iter 5 filter levels</span>
<img src="./result/200samp.5filter.png" />
</p>


### Denoise in different resolutions
To measure the denoise time in different resolutions, we very the resolution from 400 * 400 to 1000 * 1000, all using 5 denoise levels. From the plot we can see that the denoise time increases in a linear manner.
<p align="center">
<img src="./result/denoise_res_time.png" />
</p>

### Denoise performace in different scenes
We can compare the performance of the denoiser in different scenes. Here we choose 50 iterations + 5 filter levels. From the results, it seems that the denoiser performs better in fully-lighted scenarios.
||Original|Denoised|
|-------|-------|---------------|
|Cornell|<img src="./result/cornell_original.png" />|<img src="./result/cornell_denoise.png" />|
|Cornell celing|<img src="./result/ceiling_original.png" />|<img src="./result/ceiling_denoise.png" />|

35 changes: 35 additions & 0 deletions analyze.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import matplotlib.pyplot as plt

fig, ax = plt.subplots()

# render_iter = [ 104, 259, 362, 465, 568, 671, 774, 877, 980, 1083]
# render_time = [ 1.24543, 3.04093, 4.31031, 5.61925, 6.78034, 8.0182, 9.21798, 10.4139, 11.7103, 12.8612]
# render_time = [ render_time[i] / render_iter[i] for i in range(0, len(render_iter))]
# plt.plot(render_iter, render_time, label="base")

# plt.title("Average time per iteration")
# plt.xlabel("First # of iterations")
# plt.ylabel("Average time (s)")
# plt.show()

# denoise_time = [0.004441, 0.0049572, 0.0065664, 0.0072701, 0.0082553, 0.0106892, 0.0108782, 0.0116914]
# x = [i for i in range(0, len(denoise_time))]
# plt.plot(x, denoise_time)

# plt.title("Denoise time")
# plt.xlabel("# of denoise levels")
# plt.ylabel("Denoise time (s)")
# plt.show()


resolution = [400, 500, 600, 700, 800, 900, 1000]
resolution_time = [ 0.0023007, 0.0033596, 0.0046226, 0.0060183, 0.0082553, 0.0107577, 0.0126112]
plt.plot(resolution, resolution_time)

plt.title("Denoise time for 5 denoise levels")
plt.xlabel("One side resolution")
plt.ylabel("Denoise time (s)")
plt.show()



Binary file added result/200samp.1filter.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 result/200samp.2filter.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 result/200samp.3filter.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 result/200samp.4filter.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 result/200samp.5filter.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 result/200samp.6filter.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 result/200samp.7filter.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 result/ceiling_denoise.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 result/ceiling_original.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 result/cornell.2020-10-21_07-30-36z.2423samp.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 result/cornell.2020-10-21_20-11-44z.181samp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 result/cornell_denoise.png
Binary file added result/cornell_original.png
Binary file added result/denoise_res_time.png
Binary file added result/denoise_time.png
Binary file added result/render_time.png
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 50
DEPTH 8
FILE cornell
EYE 0.0 5 10.5
Expand Down
4 changes: 2 additions & 2 deletions scenes/cornell_ceiling_light.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ EMITTANCE 0
CAMERA
RES 800 800
FOVY 45
ITERATIONS 10
ITERATIONS 50
DEPTH 8
FILE cornell
FILE cornell_ceiling_light
EYE 0.0 5 10.5
LOOKAT 0 5 0
UP 0 1 0
Expand Down
Loading