Skip to content

Commit d9a311b

Browse files
committed
add ui part one
1 parent f17ec9a commit d9a311b

File tree

4 files changed

+66
-12
lines changed

4 files changed

+66
-12
lines changed

README.md

Lines changed: 66 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,75 @@ CUDA Path Tracer
33

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

6-
* (TODO) YOUR NAME HERE
7-
* Tested on: (TODO) Windows 22, i7-2222 @ 2.22GHz 22GB, GTX 222 222MB (Moore 2222 Lab)
6+
* Jiahang Mao
7+
* [LinkedIn](https://www.linkedin.com/in/jay-jiahang-m-b05608192/)
8+
* Tested on: Windows 11, i5-13600kf @ 5.0GHz 64GB, RTX 4090 24GB, Personal Computer
89

9-
### (TODO: Your README)
10+
## 1. Key feature implemented
1011

11-
1. Obj loading 2 / GLTF 4
12-
2. depth of field 2
13-
3. refraction 2
14-
4. direct lighting 2
15-
5. Russian roulette 1
12+
Part 1
13+
1. Cuda path tracing with lambertian and specular shading kernel
14+
2. Unhit path termination using Stream Compaction
15+
3. Sort ray-scene intersection by material type
16+
4. Stochastic sampled antialiasing
1617

17-
1. GLTF 4
18-
2. BVH 6
18+
Part 2
19+
1. Obj mesh import.
20+
2. BVH. Tree construction done on CPU, traversal with GPU. Configurable with either max depth or max leaf size.
21+
3. Refraction. Support transmissive-only and glass-like material.
1922

20-
### Build
23+
## 2. Build
2124

22-
Use c++ 17 instead of 14, since I added < filesystem.h > to support importing files using windows file system.
25+
Use C++ 17 or later instead of default C++ 14 with VS2022. Reason is because I added `<filesystem.h>` to support importing files using windows file system.
26+
27+
Change under property -> C/C++ -> Language -> C++ Language Standard
28+
29+
![How to](img/clang_update.png)
30+
31+
32+
## 3. Navigating UI
33+
34+
I made some updates to the UI, building on top of the imgui.
35+
36+
![UI](img/UI.png)
37+
38+
#### Mesh Options
39+
* `Centralize mesh` When loading loading arbitrary obj mesh, this option automatically compute the center and scale, then apply a transformation to the center of camera's front pov.
40+
* `Mesh transformation` Post-import transformation also customizable.
41+
#### Acceleration Structure
42+
A single choice between three options
43+
* `None` No accleration structure will be applied. For each render pass the intersection checks each ray against all geometry in the scene.
44+
* `Basic Bounding Volume Culling` Conceptually equivalent to a depth-equals-to-one BVH. Construct a single bounding box surrounding the mesh.
45+
* `Bounding Volume Hierarchy` Construct a tree-like structure to organize the geometry. The tree is built on CPU and traversed on GPU.
46+
![UI](img/bvh_ui.png)
47+
* `Bins to Split Per Axis` Controls the number of bins used when determining the best split plane during BVH construction.
48+
* `BVH Constraint` Choose between using a maximum leaf size or maximum depth as the stopping criterion for BVH construction.
49+
* `Max Leaf Size` The maximum number of primitives allowed in a leaf node.
50+
* `Max Depth` The maximum depth allowed for the BVH tree.
51+
#### Render Options
52+
* `Use Path Tracing` Toggle between path tracing and basic shading. Latter suited for quick view of geometry.
53+
* `Sort by Material` Enable/disable sorting of ray-scene intersections by material type.
54+
#### Loading file
55+
* Support either .json or .obj file. When importing an obj file, automatically load a display room scene under ./scenes/display_room.json
56+
57+
![UI](img/file_UI.png)
58+
#### Program output
59+
* Command prompt will have useful info about the mesh and bvh for debugging.
60+
```console
61+
--- Mesh Info ---
62+
Loaded 5664 vertices, 11272 faces, and 1 face materials.
63+
Auto-centering object...
64+
Geometric Center: vec3(0.108734, 0.431662, 0.382079)
65+
Average Distance to center : 1.03667
66+
--- BVH Info ---
67+
Building BVH...
68+
Validating BVH...
69+
BVH is valid. Max depth: 50, largest leaf size: 69
70+
```
71+
## 4. Performance benchmark
72+
73+
74+
### 3rd-party code used
75+
76+
* https://github.com/tinyobjloader/tinyobjloader/
2377

img/UI.png

1.72 MB
Loading

img/bvh_ui.png

14.5 KB
Loading

img/file_UI.png

8.22 KB
Loading

0 commit comments

Comments
 (0)