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 3: Xuecheng Sun #29

Open
wants to merge 8 commits into
base: master
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
11 changes: 10 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,15 @@ set(headers
src/pathtrace.h
src/scene.h
src/sceneStructs.h
src/json.hpp
src/preview.h
src/utilities.h
src/tiny_gltf.h
src/macros.h
src/gltf-loader.h
src/material.h
src/mesh.h
src/octree.h
)

set(sources
Expand All @@ -84,6 +91,8 @@ set(sources
src/scene.cpp
src/preview.cpp
src/utilities.cpp
src/gltf-loader.cc
src/octree.cpp
)

list(SORT headers)
Expand All @@ -92,7 +101,7 @@ list(SORT sources)
source_group(Headers FILES ${headers})
source_group(Sources FILES ${sources})

#add_subdirectory(stream_compaction) # TODO: uncomment if using your stream compaction
add_subdirectory(stream_compaction) # TODO: uncomment if using your stream compaction

cuda_add_executable(${CMAKE_PROJECT_NAME} ${sources} ${headers})
target_link_libraries(${CMAKE_PROJECT_NAME}
Expand Down
1 change: 1 addition & 0 deletions OpenDenoiser/oidn
Submodule oidn added at 98c106
82 changes: 77 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,83 @@ CUDA Path Tracer

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

* (TODO) YOUR NAME HERE
* Tested on: (TODO) Windows 22, i7-2222 @ 2.22GHz 22GB, GTX 222 222MB (Moore 2222 Lab)
* Xuecheng Sun
* Tested on: Windows 10, R7 3700x @3.7GHz, RTX 2070 super 8GB

### (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.

### Customized Scene: The Arsenal

![](./img/Arsenel_Blue.png)

![](./img/Arsenel_White.png)

### Path Tracer Part 1

**Finished Feature:**

1. Specular and Diffuse Ray Scatter
2. Basic stream compaction of stop thread
3. First bounce caching

![](./img/PathTracerPart1.png)



**Benchmark for First Ray Cache**

1. Sorted material can reduce the divergence in a thread warp which can significantly boost the render speed.

2. First bounce cache always provide a constant value improvement with different depth setting

![](img/PathTracerDepth.png)

### Path Tracer Part 2 and 3

**1. Different Materials**

Implemented perfect refractive, perfect reflective and Schlick's approximation fresnel materials:

![](./img/DiffMat.png)

**2. Depth of Field and AA**

![](./img/DiffMat_DOF_AA_Comp.png)

**3.Arbitrary Mesh(GLTF) Import**

​ **Extra Points: Texture Mapping: Base Color, Normal and Roughness**

![](./img/GLTF.png)

**4. Direct Light**

![](./img/directLighting.png)

**5. Advance Sampling Method: Halton Sequence**

**Halton Direct Light Sampling**

![](./img/HaltonDirect.png)

**Random Direct Light Sampling as Reference**

![](./img/RandomDirect.png)

Shadows under Halton Sampling are more regularized.

**6. Octree(Partially)**

I build the octree for primitives and triangle but find for mesh triangles, it always aggregates in the root node which finally slow down the rendering.

### Benchmark for Bounding Box

![](./img/BoundingBoxBM.png)

For a very simple mesh such as cube the bounding box didn't help much for the rendering speed, but if we render a more complex mesh like pistol or duck which have more than 4000 triangles, the bounding box improved the performance greatly.



### Third Libraries

Tinygltf libraries: GLTF Loader
Binary file added WeChat Image_20201001105732.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 build.7z
Binary file not shown.
Binary file added build/.vs/cis565_path_tracer/v16/.suo
Binary file not shown.
Binary file added build/.vs/cis565_path_tracer/v16/Solution.VC.db
Binary file not shown.
184 changes: 184 additions & 0 deletions build/ALL_BUILD.vcxproj

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions build/ALL_BUILD.vcxproj.filters
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="16.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<CustomBuild Include="E:\Learning\CIS565\Project3-CUDA-Path-Tracer\CMakeLists.txt" />
</ItemGroup>
<ItemGroup>
</ItemGroup>
</Project>
4 changes: 4 additions & 0 deletions build/ALL_BUILD.vcxproj.user
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
</Project>
Loading