Skip to content

Commit f6826db

Browse files
committed
More evaluation
1 parent 5d79574 commit f6826db

File tree

11 files changed

+164
-28
lines changed

11 files changed

+164
-28
lines changed

scenes/evaluation/multilight.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,24 @@
5555
"name": "__light_0",
5656
"type": "area",
5757
"entity": "__light",
58-
"radiance": [1,1,1]
58+
"radiance": 0.5
5959
},
6060
{
6161
"name": "__light_1",
6262
"type": "constant",
6363
"radiance": [0.2,0.2,0.2]
64+
},
65+
{
66+
"name": "__light_2",
67+
"type": "point",
68+
"intensity": [1.2566370614, 2.513274123, 12.566370614],
69+
"position": [-1, 0.25, 0]
70+
},
71+
{
72+
"name": "__light_3",
73+
"type": "point",
74+
"intensity": [12.566370614, 2.513274123, 1.2566370614],
75+
"position": [1, 0.25, 0]
6476
}
6577
]
6678
}

scenes/evaluation/multilight.xml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,25 @@
4444
<string name="filename" value="../meshes/Top.ply"/>
4545
<ref id="Black"/>
4646
<emitter type="area">
47-
<spectrum name="radiance" value="1"/>
47+
<spectrum name="radiance" value="0.5"/>
4848
</emitter>
4949
</shape>
5050

51-
<emitter type="constant" id="emitter">
51+
<emitter type="constant" id="emitter1">
5252
<rgb name="radiance" value="0.2, 0.2, 0.2"/>
5353
</emitter>
54+
55+
<emitter type="point" id="emitter2">
56+
<rgb name="intensity" value="0.1, 0.2, 1"/>
57+
<transform name="to_world">
58+
<translate x="-1" y="0.25" z="0"/>
59+
</transform>
60+
</emitter>
61+
62+
<emitter type="point" id="emitter3">
63+
<rgb name="intensity" value="1, 0.2, 0.1"/>
64+
<transform name="to_world">
65+
<translate x="1" y="0.25" z="0"/>
66+
</transform>
67+
</emitter>
5468
</scene>

scenes/evaluation/point.json

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{
2+
"technique": {
3+
"type": "path",
4+
"max_depth": 4
5+
},
6+
"camera": {
7+
"type": "perspective",
8+
"fov": 90,
9+
"near_clip": 0.01,
10+
"far_clip": 100,
11+
"transform": { "lookat": {"origin":[0, 0, -2], "direction": [0,0,1], "up":[0,1,0]} }
12+
},
13+
"film": {
14+
"size": [256, 256]
15+
},
16+
"textures": [],
17+
"bsdfs": [
18+
{
19+
"name": "Bottom",
20+
"type": "diffuse",
21+
"reflectance": [0.885809, 0.698859, 0.666422]
22+
},
23+
{
24+
"name": "Black",
25+
"type": "diffuse",
26+
"reflectance": [0, 0, 0]
27+
}
28+
],
29+
"shapes": [
30+
{
31+
"name": "Bottom",
32+
"type": "ply",
33+
"filename": "../meshes/Bottom.ply"
34+
}
35+
],
36+
"entities": [
37+
{
38+
"name": "__entity_1",
39+
"shape": "Bottom",
40+
"bsdf": "Bottom"
41+
}
42+
],
43+
"lights": [
44+
{
45+
"name": "__light_0",
46+
"type": "point",
47+
"position": [0,1,0],
48+
"intensity": 12.566370614 // TODO: Maybe make the 4*pi part of the actual parameter?
49+
}
50+
]
51+
}

scenes/evaluation/point.xml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<scene version="2.0.0">
2+
<default name="spp" value="4096"/>
3+
<default name="res" value="256"/>
4+
<default name="max_depth" value="4"/>
5+
6+
<integrator type="path">
7+
<integer name="max_depth" value="$max_depth"/>
8+
</integrator>
9+
10+
<sensor type="perspective">
11+
<float name="near_clip" value="0.00001"/>
12+
<float name="far_clip" value="100"/>
13+
<float name="fov" value="90"/>
14+
<transform name="to_world">
15+
<lookat origin="0,0,-2"
16+
target="0,0,0"
17+
up ="0,1,0"/>
18+
</transform>
19+
<sampler type="independent"> <!-- ldsampler -->
20+
<integer name="sample_count" value="$spp"/>
21+
</sampler>
22+
<film type="hdrfilm">
23+
<integer name="width" value="$res"/>
24+
<integer name="height" value="$res"/>
25+
<rfilter type="box"/>
26+
<string name="pixel_format" value="rgb"/>
27+
</film>
28+
</sensor>
29+
30+
<bsdf type="diffuse" id="Bottom">
31+
<rgb name="reflectance" value="0.885809, 0.698859, 0.666422"/>
32+
</bsdf>
33+
34+
<bsdf type="diffuse" id="Black">
35+
<rgb name="reflectance" value="0, 0, 0"/>
36+
</bsdf>
37+
38+
<shape type="ply">
39+
<string name="filename" value="../meshes/Bottom.ply"/>
40+
<ref id="Bottom"/>
41+
</shape>
42+
43+
<emitter type="point" id="emitter">
44+
<rgb name="intensity" value="1"/>
45+
<transform name="to_world">
46+
<translate x="0" y="1" z="0"/>
47+
</transform>
48+
</emitter>
49+
</scene>
-2.2 KB
Binary file not shown.
34.1 KB
Binary file not shown.

scenes/many_point_lights_scene.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"technique": {
33
"type": "path",
44
"max_depth": 64,
5-
"light_selector": "simple"
5+
"light_selector": "hierarchy"
66
},
77
"camera": {
88
"type": "perspective",

scripts/MakeEvaluationFigure.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ def error_image(img, ref):
5353
("multilight-uniform", "multilight", 4),
5454
("multilight-simple", "multilight", 4),
5555
("multilight-hierarchy", "multilight", 4),
56+
("point", None, 4),
5657
]
5758

5859
image_names = [f"{scene}4096-d{depth}" for (scene, _, depth) in scenes]

scripts/run_evaluations.sh

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,30 @@ output_dir=.
1111

1212
args="--spp ${spp} $@"
1313

14-
# igcli ${args} -o ${output_dir}/cbox${spp}-d6.exr ${scene_dir}/cbox.json --gpu
15-
# igcli ${args} -o ${output_dir}/cbox${spp}-d1.exr ${scene_dir}/cbox-d1.json --gpu
16-
# igcli ${args} -o ${output_dir}/cbox${spp}-cpu-d6.exr ${scene_dir}/cbox.json --cpu
17-
# igcli ${args} -o ${output_dir}/cbox${spp}-cpu-d1.exr ${scene_dir}/cbox-d1.json --cpu
14+
igcli ${args} -o ${output_dir}/cbox${spp}-d6.exr ${scene_dir}/cbox.json --gpu
15+
igcli ${args} -o ${output_dir}/cbox${spp}-d1.exr ${scene_dir}/cbox-d1.json --gpu
16+
igcli ${args} -o ${output_dir}/cbox${spp}-cpu-d6.exr ${scene_dir}/cbox.json --cpu
17+
igcli ${args} -o ${output_dir}/cbox${spp}-cpu-d1.exr ${scene_dir}/cbox-d1.json --cpu
1818

19-
# igcli ${args} -o ${output_dir}/plane${spp}-d6.exr ${scene_dir}/plane.json --gpu
20-
# igcli ${args} -o ${output_dir}/plane${spp}-d1.exr ${scene_dir}/plane-d1.json --gpu
21-
# igcli ${args} -o ${output_dir}/plane${spp}-cpu-d6.exr ${scene_dir}/plane.json --cpu
22-
# igcli ${args} -o ${output_dir}/plane${spp}-cpu-d1.exr ${scene_dir}/plane-d1.json --cpu
19+
igcli ${args} -o ${output_dir}/plane${spp}-d6.exr ${scene_dir}/plane.json --gpu
20+
igcli ${args} -o ${output_dir}/plane${spp}-d1.exr ${scene_dir}/plane-d1.json --gpu
21+
igcli ${args} -o ${output_dir}/plane${spp}-cpu-d6.exr ${scene_dir}/plane.json --cpu
22+
igcli ${args} -o ${output_dir}/plane${spp}-cpu-d1.exr ${scene_dir}/plane-d1.json --cpu
2323

24-
# igcli ${args} -o ${output_dir}/room${spp}-d4.exr ${scene_dir}/room.json --gpu
24+
igcli ${args} -o ${output_dir}/room${spp}-d4.exr ${scene_dir}/room.json --gpu
2525

26-
# igcli ${args} -o ${output_dir}/plane-scale${spp}-d4.exr ${scene_dir}/plane-scale.json --gpu
26+
igcli ${args} -o ${output_dir}/plane-scale${spp}-d4.exr ${scene_dir}/plane-scale.json --gpu
2727

28-
# igcli ${args} -o ${output_dir}/volume${spp}-d12.exr ${scene_dir}/volume.json --gpu
28+
igcli ${args} -o ${output_dir}/volume${spp}-d12.exr ${scene_dir}/volume.json --gpu
2929

30-
# igcli ${args} -o ${output_dir}/env${spp}-d6.exr ${scene_dir}/env.json --gpu
31-
# igcli ${args} -o ${output_dir}/env4k${spp}-d6.exr ${scene_dir}/env4k.json --gpu
32-
# igcli ${args} -o ${output_dir}/env4kNoCDF${spp}-d6.exr ${scene_dir}/env4kNoCDF.json --gpu
30+
igcli ${args} -o ${output_dir}/env${spp}-d6.exr ${scene_dir}/env.json --gpu
31+
igcli ${args} -o ${output_dir}/env4k${spp}-d6.exr ${scene_dir}/env4k.json --gpu
32+
igcli ${args} -o ${output_dir}/env4kNoCDF${spp}-d6.exr ${scene_dir}/env4kNoCDF.json --gpu
3333

3434
igcli ${args} -o ${output_dir}/multilight-uniform${spp}-d4.exr ${scene_dir}/multilight-uniform.json --gpu
3535
igcli ${args} -o ${output_dir}/multilight-simple${spp}-d4.exr ${scene_dir}/multilight-simple.json --gpu
3636
igcli ${args} -o ${output_dir}/multilight-hierarchy${spp}-d4.exr ${scene_dir}/multilight-hierarchy.json --gpu
3737

38+
igcli ${args} -o ${output_dir}/point${spp}-d4.exr ${scene_dir}/point.json --gpu
39+
3840
python3 ${script} ${output_dir}/ ${scene_dir}/

src/artic/impl/light_hierarchy.art

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,21 @@ struct LightHierarchy {
101101
}
102102

103103
fn @make_light_hierarchy(finite_lights: LightTable, full: DeviceBuffer) -> LightHierarchy {
104-
let codes = full;
105-
let data = shift_device_buffer(round_up(finite_lights.count, 4), 0, full);
106-
107-
LightHierarchy {
108-
sample = @|rnd, pos| {
109-
let (id, pdf) = light_hierarchy::sample_light_id(rnd, pos, data);
110-
(finite_lights.get(id), pdf)
111-
},
112-
pdf = @|light, pos| light_hierarchy::compute_pdf(light, pos, codes, data)
104+
if ?finite_lights.count && finite_lights.count == 1 {
105+
LightHierarchy {
106+
sample = @|_, _| (finite_lights.get(0), 1:f32),
107+
pdf = @|_, _| 1:f32
108+
}
109+
} else {
110+
let codes = full;
111+
let data = shift_device_buffer(round_up(finite_lights.count, 4), 0, full);
112+
113+
LightHierarchy {
114+
sample = @|rnd, pos| {
115+
let (id, pdf) = light_hierarchy::sample_light_id(rnd, pos, data);
116+
(finite_lights.get(id), pdf)
117+
},
118+
pdf = @|light, pos| light_hierarchy::compute_pdf(light, pos, codes, data)
119+
}
113120
}
114121
}

0 commit comments

Comments
 (0)