Skip to content

Commit

Permalink
data_diff
Browse files Browse the repository at this point in the history
  • Loading branch information
W-Solaris committed Dec 6, 2023
1 parent f656023 commit c4571ef
Show file tree
Hide file tree
Showing 13 changed files with 395 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -302,3 +302,5 @@ CMakeSettings.json
/imgui.ini
/set_accel_kernel
/results.txt

/data/
166 changes: 166 additions & 0 deletions cbox_diff/cbox-diff/cbox-diff-2.luisa
Original file line number Diff line number Diff line change
@@ -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 }
}
111 changes: 111 additions & 0 deletions cbox_diff/cbox-diff/cbox-ref-2.luisa
Original file line number Diff line number Diff line change
@@ -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 }
}
9 changes: 9 additions & 0 deletions cbox_diff/meshes/cbox-parts/back-wall.obj
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions cbox_diff/meshes/cbox-parts/ceiling.obj
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions cbox_diff/meshes/cbox-parts/floor.obj
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions cbox_diff/meshes/cbox-parts/left-wall.obj
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions cbox_diff/meshes/cbox-parts/light.obj
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions cbox_diff/meshes/cbox-parts/right-wall.obj
Original file line number Diff line number Diff line change
@@ -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
41 changes: 41 additions & 0 deletions cbox_diff/meshes/cbox-parts/short-box.obj
Original file line number Diff line number Diff line change
@@ -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
Loading

0 comments on commit c4571ef

Please sign in to comment.