Skip to content

Commit e0c03c3

Browse files
committedAug 13, 2019
+
1 parent 8a5d0bb commit e0c03c3

File tree

7 files changed

+42
-77
lines changed

7 files changed

+42
-77
lines changed
 

‎DeepestScatter_DataGen/DeepestScatter_DataGen/src/ExecutionLoop/GuiExecutionLoop.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ namespace DeepestScatter
3535

3636
static GuiExecutionLoop* instance;
3737

38-
uint32_t width = 1792u;
39-
uint32_t height = 1024u;
38+
uint32_t width = 512u;
39+
uint32_t height = 512u;
4040

4141
// Mouse state
4242
optix::int2 mousePrevPos = optix::make_int2(0, 0);

‎DeepestScatter_DataGen/DeepestScatter_DataGen/src/ExecutionLoop/Tasks.cpp

+37-12
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,35 @@
1919

2020
namespace DeepestScatter
2121
{
22-
namespace di = Hypodermic;
23-
24-
uint32_t width = 1792u;
25-
uint32_t height = 1024u;
26-
2722
enum class LightDirection {
2823
Front, Back, Side
2924
};
25+
}
26+
27+
namespace std
28+
{
29+
std::string to_string(DeepestScatter::LightDirection direction)
30+
{
31+
switch (direction)
32+
{
33+
case DeepestScatter::LightDirection::Front:
34+
return "Front";
35+
case DeepestScatter::LightDirection::Back:
36+
return "Back";
37+
case DeepestScatter::LightDirection::Side:
38+
return "Side";
39+
default:
40+
throw std::exception("Unexpected direction");
41+
}
42+
}
43+
}
44+
45+
namespace DeepestScatter
46+
{
47+
namespace di = Hypodermic;
48+
49+
uint32_t width = 512u;
50+
uint32_t height = 256u;
3051

3152
optix::float3 getLightDirection(LightDirection direction)
3253
{
@@ -43,19 +64,17 @@ namespace DeepestScatter
4364

4465
}
4566

46-
std::queue<GuiExecutionLoop::LazyTask> Tasks::renderCloud(const std::string &cloudPath, float sizeM)
67+
GuiExecutionLoop::LazyTask renderCloudSingleTask(const std::string &cloudPath, float sizeM, LightDirection lightDirection)
4768
{
48-
std::queue<GuiExecutionLoop::LazyTask> tasks;
49-
50-
GuiExecutionLoop::LazyTask task = [=]()
69+
return [=]()
5170
{
5271
di::ContainerBuilder taskBuilder;
5372

5473
Persistance::SceneSetup sceneSetup{};
5574
sceneSetup.set_cloud_path(cloudPath);
5675
sceneSetup.set_cloud_size_m(sizeM);
5776

58-
optix::float3 direction = getLightDirection(LightDirection::Front);
77+
optix::float3 direction = getLightDirection(lightDirection);
5978
sceneSetup.mutable_light_direction()->set_x(direction.x);
6079
sceneSetup.mutable_light_direction()->set_y(direction.y);
6180
sceneSetup.mutable_light_direction()->set_z(direction.z);
@@ -68,7 +87,7 @@ namespace DeepestScatter
6887
taskBuilder.registerType<TRenderer>().as<ARenderer>().singleInstance();
6988
auto outputPath =
7089
std::filesystem::path("../../Data/Renders") /
71-
std::filesystem::path(cloudPath).filename().replace_extension(TRenderer::NAME + ".exr");
90+
std::filesystem::path(cloudPath).filename().replace_extension(std::to_string(lightDirection) + "." + TRenderer::NAME + ".exr");
7291
taskBuilder.addRegistrations(installFramework(width, height, outputPath));
7392
taskBuilder.addRegistrations(installSceneSetup(sceneSetup, ".", Cloud::Rendering::Mode::SunAndSkyAllScatter, Cloud::Model::Mipmaps::On));
7493
taskBuilder.addRegistrations(installApp());
@@ -80,8 +99,14 @@ namespace DeepestScatter
8099

81100
return container;
82101
};
102+
}
103+
104+
std::queue<GuiExecutionLoop::LazyTask> Tasks::renderCloud(const std::string &cloudPath, float sizeM)
105+
{
106+
std::queue<GuiExecutionLoop::LazyTask> tasks;
83107

84-
tasks.push(task);
108+
tasks.push(renderCloudSingleTask(cloudPath, sizeM, LightDirection::Side));
109+
tasks.push(renderCloudSingleTask(cloudPath, sizeM, LightDirection::Back));
85110

86111
return tasks;
87112
}

‎DeepestScatter_DataGen/DeepestScatter_DataGen/src/Scene/Cameras/Camera.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ namespace DeepestScatter
186186
}
187187

188188
//todo: configurable subframe count
189-
for (int i = 0; i < 1; i++)
189+
for (int i = 0; i < 10; i++)
190190
{
191191
subframeId++;
192192
context["subframeId"]->setUint(subframeId);
@@ -263,7 +263,8 @@ namespace DeepestScatter
263263
std::cout << "Converged: " << convergedCount << "/" << runningVariance.getData().size()
264264
<< " --- " << runningVariance.getData().size() - convergedCount << "left" << std::endl;
265265

266-
return isConverged;
266+
//TODO:
267+
return runningVariance.getData().size() - convergedCount < 500;
267268
}
268269

269270
void Camera::increaseExposure()

‎DeepestScatter_Train/ExportPytorchModel.py

-61
This file was deleted.

‎DeepestScatter_Train/Utils/ExrToPng.py

Whitespace-only changes.

0 commit comments

Comments
 (0)
Please sign in to comment.