Skip to content

Commit 6cbb1fb

Browse files
committed
添加了README
添加了testcase用于场景演示 移除了threadpool依赖
1 parent cb40957 commit 6cbb1fb

File tree

5 files changed

+75
-13
lines changed

5 files changed

+75
-13
lines changed

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
/target
2-
/testcases
32
/outputs
43
sppm.code-workspace

Cargo.lock

-10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,4 @@ rand = "0.8.4"
1414
lazy_static = "1.4.0"
1515
image = "0.23.14"
1616
num-complex = "0.4.0"
17-
adqselect = "0.1.3"
18-
threadpool = "1.8.1"
17+
adqselect = "0.1.3"

README.md

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# rust-SPPM
2+
3+
清华大学计算机图形学基础真实感渲染大作业的一个rust实现(未完成)
4+
5+
## 已完成的功能
6+
7+
+ 基于随机渐进式光子映射(SPPM)的真实感渲染
8+
9+
+ 基本几何体、几何变换的渲染
10+
11+
+ obj模型的读取和渲染
12+
13+
## 待完成的功能
14+
15+
+ 多线程支持
16+
17+
+ 纹理映射
18+
19+
+ 更多的材质
20+
21+
## Build
22+
23+
`cargo build --release`
24+
25+
## Build and Run
26+
27+
`cargo run --release <scene_file> <output_file>`
28+
29+
由于image库的限制,`output_file`最好为`jpg``png`格式。

testcases/first.json

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"Camera": {
3+
"Type": "Perspective",
4+
"Center": [-10, 20, 100],
5+
"Direction": [0, -0.1, -1],
6+
"Up": [0, 1, 0],
7+
"Angle": 45,
8+
"Width": 800,
9+
"Height": 600
10+
},
11+
"Lights": [
12+
{
13+
"Type": "DirectionCircleLight",
14+
"Position": [100, 100, -100],
15+
"Normal": [-1, -1, 1],
16+
"Flux": [1, 1, 1],
17+
"Radius": 30,
18+
"Scale": 20000
19+
}
20+
],
21+
"Materials": [
22+
{
23+
"Type": "DIFF",
24+
"Color": [0.75, 0.25, 0.25]
25+
},
26+
{
27+
"Type": "DIFF",
28+
"Color": [0.3, 0.3, 0.4]
29+
}
30+
],
31+
"Group": [
32+
{
33+
"Type": "Plane",
34+
"MaterialIndex": 1,
35+
"Normal": [0, 1, 0],
36+
"Offset": 0
37+
},
38+
{
39+
"Type": "Sphere",
40+
"MaterialIndex": 0,
41+
"Center": [-15, 5, 32],
42+
"Radius": 5
43+
}
44+
]
45+
}

0 commit comments

Comments
 (0)