diff --git a/.gitignore b/.gitignore index 2f71be50..240fbf0c 100644 --- a/.gitignore +++ b/.gitignore @@ -302,3 +302,5 @@ CMakeSettings.json /imgui.ini /set_accel_kernel /results.txt + +/data/ diff --git a/cbox_diff/cbox-diff/cbox-diff-2.luisa b/cbox_diff/cbox-diff/cbox-diff-2.luisa new file mode 100644 index 00000000..5a7653fe --- /dev/null +++ b/cbox_diff/cbox-diff/cbox-diff-2.luisa @@ -0,0 +1,166 @@ +// mat_cbox +Surface cbox-white : Matte { + Kd : Constant { + //v { 0.725, 0.71, 0.68 } + v { 0.1, 0.1, 0.1 } + requires_grad { true } + range { 0.00001, 0.99999 } + } +} + +Surface cbox-white-1 : Matte { + Kd : Constant { + v { 0.2, 0.8, 0.2 } + requires_grad { true } + range { 0.00001, 0.99999 } + } +} + +Surface cbox-white-2 : Matte { + Kd : Constant { + v { 0.3, 0.3, 0.9 } + requires_grad { true } + range { 0.00001, 0.99999 } + } +} + +Surface cbox-white-3 : Matte { + Kd : Constant { + v { 0.4, 0.4, 0.4 } + requires_grad { true } + range { 0.00001, 0.99999 } + } +} + +Surface cbox-white-4 : Matte { + Kd : Constant { + v { 0.5, 0.3, 0.3 } + requires_grad { true } + range { 0.00001, 0.99999 } + } +} + +Surface cbox-green : Matte { + Kd : Constant { + //v { 0.14, 0.45, 0.091 } + v { 0.8, 0.5, 0.1 } + requires_grad { true } + range { 0.00001, 0.99999 } + } +} + +Surface cbox-red : Matte { + Kd : Constant { + //v { 0.63, 0.065, 0.05 } + v { 0.9, 0.9, 0.9 } + requires_grad { true } + range { 0.00001, 0.99999 } + } +} + +// shape_cbox +Shape cbox-ceiling : Mesh { + file { "../../meshes/cbox-parts/ceiling.obj" } + surface { @cbox-white } +} + +Shape cbox-floor : Mesh { + file { "../../meshes/cbox-parts/floor.obj" } + surface { @cbox-white-1 } +} + +Shape cbox-left-wall : Mesh { + file { "../../meshes/cbox-parts/left-wall.obj" } + surface { @cbox-red } +} + +Shape cbox-right-wall : Mesh { + file { "../../meshes/cbox-parts/right-wall.obj" } + surface { @cbox-green } +} + +Shape cbox-back-wall : Mesh { + file { "../../meshes/cbox-parts/back-wall.obj" } + surface { @cbox-white-2 } +} + + +Shape cbox-light : Mesh { + file { "../../meshes/cbox-parts/light.obj" } + light : Diffuse { + emission : Constant { + //v { 10, 10, 10 } + v { 45.0, 45.0, 45.0 } + } + } +} + +Shape cbox-tall-box : Mesh { + file { "../../meshes/cbox-parts/tall-box.obj" } + surface { @cbox-white-3 } +} + +Shape cbox-short-box : Mesh { + file { "../../meshes/cbox-parts/short-box.obj" } + surface { @cbox-white-4 } +} + + +Shape cbox : Group { + shapes { + @cbox-left-wall, + @cbox-ceiling, + @cbox-floor, + @cbox-right-wall, + @cbox-back-wall, + @cbox-tall-box, + @cbox-short-box, + @cbox-light + } +} + +Film film : Color { + resolution { 1024 } + exposure { 0 } +} + +Camera camera : Pinhole { + position { 0.0, 1.0, 5.0 } + fov { 27.8 } + spp { 1024 } + film { @film } + file { "../../renders/cbox-diff.exr" } + filter : Gaussian { + radius { 1 } + } + target : Image { + file { "../../renders/cbox-ref.exr" } + } +} + +//Integrator pt : MegaRadiativeDiff { +Integrator pt : MegaReplayDiff { + sampler : Independent {} + depth { 10 } + rr_depth { 5 } + + display_camera_index { 0 } + save_process { true } + loss : L2 {} + iterations { 100 } + + optimizer : Adam { + learning_rate { 0.003 } + } +} + +render { + spectrum : sRGB {} + cameras { + @camera + } + shapes { + @cbox + } + integrator { @pt } +} diff --git a/cbox_diff/cbox-diff/cbox-ref-2.luisa b/cbox_diff/cbox-diff/cbox-ref-2.luisa new file mode 100644 index 00000000..aefab0ca --- /dev/null +++ b/cbox_diff/cbox-diff/cbox-ref-2.luisa @@ -0,0 +1,111 @@ +// mat_cbox +Surface cbox-white : Matte { + Kd : Constant { + v { 0.725, 0.71, 0.68 } + } +} + +Surface cbox-green : Matte { + Kd : Constant { + v { 0.14, 0.45, 0.091 } + } +} + +Surface cbox-red : Matte { + Kd : Constant { + v { 0.63, 0.065, 0.05 } + } +} + +// shape_cbox +Shape cbox-ceiling : Mesh { + file { "../../meshes/cbox-parts/ceiling.obj" } + surface { @cbox-white } +} + +Shape cbox-floor : Mesh { + file { "../../meshes/cbox-parts/floor.obj" } + surface { @cbox-white } +} + +Shape cbox-left-wall : Mesh { + file { "../../meshes/cbox-parts/left-wall.obj" } + surface { @cbox-red } +} + +Shape cbox-right-wall : Mesh { + file { "../../meshes/cbox-parts/right-wall.obj" } + surface { @cbox-green } +} + +Shape cbox-back-wall : Mesh { + file { "../../meshes/cbox-parts/back-wall.obj" } + surface { @cbox-white } +} + + +Shape cbox-light : Mesh { + file { "../../meshes/cbox-parts/light.obj" } + light : Diffuse { + emission : Constant { + v { 45.0, 45.0, 45.0 } + } + } +} + +Shape cbox-tall-box : Mesh { + file { "../../meshes/cbox-parts/tall-box.obj" } + surface { @cbox-white } +} + +Shape cbox-short-box : Mesh { + file { "../../meshes/cbox-parts/short-box.obj" } + surface { @cbox-white } +} + + +Shape cbox : Group { + shapes { + @cbox-floor, + @cbox-ceiling, + @cbox-left-wall, + @cbox-right-wall, + @cbox-back-wall, + @cbox-tall-box, + @cbox-short-box, + @cbox-light + } +} + +Film film : Color { + resolution { 1024 } + exposure { 0 } +} + +Camera camera : Pinhole { + position { 0.0, 1.0, 5.0 } + fov { 27.8 } + spp { 1024 } + film { @film } + file { "../../renders/cbox-ref.exr" } + filter : Gaussian { + radius { 1 } + } +} + +Integrator pt : MegaPath { + sampler : Independent {} + depth { 10 } + rr_depth { 5 } +} + +render { + spectrum : sRGB {} + cameras { + @camera + } + shapes { + @cbox + } + integrator { @pt } +} diff --git a/cbox_diff/meshes/cbox-parts/back-wall.obj b/cbox_diff/meshes/cbox-parts/back-wall.obj new file mode 100644 index 00000000..0bd18b23 --- /dev/null +++ b/cbox_diff/meshes/cbox-parts/back-wall.obj @@ -0,0 +1,9 @@ +v -1.00 0.00 -1.00 +v 1.00 0.00 -1.00 +v 1.00 2.00 -1.00 +v -1.00 2.00 -1.00 +vt 0 1 +vt 1 1 +vt 1 0 +vt 0 0 +f -4/-4 -3/-3 -2/-2 -1/-1 diff --git a/cbox_diff/meshes/cbox-parts/ceiling.obj b/cbox_diff/meshes/cbox-parts/ceiling.obj new file mode 100644 index 00000000..8da3b1ac --- /dev/null +++ b/cbox_diff/meshes/cbox-parts/ceiling.obj @@ -0,0 +1,5 @@ +v -1.00 2.00 1.00 +v -1.00 2.00 -1.00 +v 1.00 2.00 -1.00 +v 1.00 2.00 1.00 +f -4 -3 -2 -1 \ No newline at end of file diff --git a/cbox_diff/meshes/cbox-parts/floor.obj b/cbox_diff/meshes/cbox-parts/floor.obj new file mode 100644 index 00000000..4ab9b6ee --- /dev/null +++ b/cbox_diff/meshes/cbox-parts/floor.obj @@ -0,0 +1,5 @@ +v -1.00 0.00 1.00 +v 1.00 0.00 1.00 +v 1.00 0.00 -1.00 +v -1.00 0.00 -1.00 +f -4 -3 -2 -1 diff --git a/cbox_diff/meshes/cbox-parts/left-wall.obj b/cbox_diff/meshes/cbox-parts/left-wall.obj new file mode 100644 index 00000000..834a6120 --- /dev/null +++ b/cbox_diff/meshes/cbox-parts/left-wall.obj @@ -0,0 +1,5 @@ +v -1.00 0.00 1.00 +v -1.00 0.00 -1.00 +v -1.00 2.00 -1.00 +v -1.00 2.00 1.00 +f -4 -3 -2 -1 diff --git a/cbox_diff/meshes/cbox-parts/light.obj b/cbox_diff/meshes/cbox-parts/light.obj new file mode 100644 index 00000000..2f817835 --- /dev/null +++ b/cbox_diff/meshes/cbox-parts/light.obj @@ -0,0 +1,5 @@ +v -0.24 1.98 0.16 +v -0.24 1.98 -0.22 +v 0.23 1.98 -0.22 +v 0.23 1.98 0.16 +f -4 -3 -2 -1 diff --git a/cbox_diff/meshes/cbox-parts/right-wall.obj b/cbox_diff/meshes/cbox-parts/right-wall.obj new file mode 100644 index 00000000..f415a00d --- /dev/null +++ b/cbox_diff/meshes/cbox-parts/right-wall.obj @@ -0,0 +1,5 @@ +v 1.00 0.00 -1.00 +v 1.00 0.00 1.00 +v 1.00 2.00 1.00 +v 1.00 2.00 -1.00 +f -4 -3 -2 -1 diff --git a/cbox_diff/meshes/cbox-parts/short-box.obj b/cbox_diff/meshes/cbox-parts/short-box.obj new file mode 100644 index 00000000..742a8e65 --- /dev/null +++ b/cbox_diff/meshes/cbox-parts/short-box.obj @@ -0,0 +1,41 @@ +# Top Face +v 0.53 0.60 0.75 +v 0.70 0.60 0.17 +v 0.13 0.60 0.00 +v -0.05 0.60 0.57 +f -4 -3 -2 -1 + +# Left Face +v -0.05 0.00 0.57 +v -0.05 0.60 0.57 +v 0.13 0.60 0.00 +v 0.13 0.00 0.00 +f -4 -3 -2 -1 + +# Front Face +v 0.53 0.00 0.75 +v 0.53 0.60 0.75 +v -0.05 0.60 0.57 +v -0.05 0.00 0.57 +f -4 -3 -2 -1 + +# Right Face +v 0.70 0.00 0.17 +v 0.70 0.60 0.17 +v 0.53 0.60 0.75 +v 0.53 0.00 0.75 +f -4 -3 -2 -1 + +# Back Face +v 0.13 0.00 0.00 +v 0.13 0.60 0.00 +v 0.70 0.60 0.17 +v 0.70 0.00 0.17 +f -4 -3 -2 -1 + +# Bottom Face +v 0.53 0.00 0.75 +v 0.70 0.00 0.17 +v 0.13 0.00 0.00 +v -0.05 0.00 0.57 +f -12 -11 -10 -9 diff --git a/cbox_diff/meshes/cbox-parts/tall-box.obj b/cbox_diff/meshes/cbox-parts/tall-box.obj new file mode 100644 index 00000000..1fc35a86 --- /dev/null +++ b/cbox_diff/meshes/cbox-parts/tall-box.obj @@ -0,0 +1,41 @@ +# Top Face +v -0.53 1.20 0.09 +v 0.04 1.20 -0.09 +v -0.14 1.20 -0.67 +v -0.71 1.20 -0.49 +f -4 -3 -2 -1 + +# Left Face +v -0.53 0.00 0.09 +v -0.53 1.20 0.09 +v -0.71 1.20 -0.49 +v -0.71 0.00 -0.49 +f -4 -3 -2 -1 + +# Back Face +v -0.71 0.00 -0.49 +v -0.71 1.20 -0.49 +v -0.14 1.20 -0.67 +v -0.14 0.00 -0.67 +f -4 -3 -2 -1 + +# Right Face +v -0.14 0.00 -0.67 +v -0.14 1.20 -0.67 +v 0.04 1.20 -0.09 +v 0.04 0.00 -0.09 +f -4 -3 -2 -1 + +# Front Face +v 0.04 0.00 -0.09 +v 0.04 1.20 -0.09 +v -0.53 1.20 0.09 +v -0.53 0.00 0.09 +f -4 -3 -2 -1 + +# Bottom Face +v -0.53 0.00 0.09 +v 0.04 0.00 -0.09 +v -0.14 0.00 -0.67 +v -0.71 0.00 -0.49 +f -8 -7 -6 -5 diff --git a/cbox_diff/renders/cbox-diff.exr b/cbox_diff/renders/cbox-diff.exr new file mode 100644 index 00000000..a410c4c1 Binary files /dev/null and b/cbox_diff/renders/cbox-diff.exr differ diff --git a/cbox_diff/renders/cbox-ref.exr b/cbox_diff/renders/cbox-ref.exr new file mode 100644 index 00000000..0307289c Binary files /dev/null and b/cbox_diff/renders/cbox-ref.exr differ