19
19
20
20
namespace DeepestScatter
21
21
{
22
- namespace di = Hypodermic;
23
-
24
- uint32_t width = 1792u ;
25
- uint32_t height = 1024u ;
26
-
27
22
enum class LightDirection {
28
23
Front, Back, Side
29
24
};
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 ;
30
51
31
52
optix::float3 getLightDirection (LightDirection direction)
32
53
{
@@ -43,19 +64,17 @@ namespace DeepestScatter
43
64
44
65
}
45
66
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 )
47
68
{
48
- std::queue<GuiExecutionLoop::LazyTask> tasks;
49
-
50
- GuiExecutionLoop::LazyTask task = [=]()
69
+ return [=]()
51
70
{
52
71
di::ContainerBuilder taskBuilder;
53
72
54
73
Persistance::SceneSetup sceneSetup{};
55
74
sceneSetup.set_cloud_path (cloudPath);
56
75
sceneSetup.set_cloud_size_m (sizeM);
57
76
58
- optix::float3 direction = getLightDirection (LightDirection::Front );
77
+ optix::float3 direction = getLightDirection (lightDirection );
59
78
sceneSetup.mutable_light_direction ()->set_x (direction.x );
60
79
sceneSetup.mutable_light_direction ()->set_y (direction.y );
61
80
sceneSetup.mutable_light_direction ()->set_z (direction.z );
@@ -68,7 +87,7 @@ namespace DeepestScatter
68
87
taskBuilder.registerType <TRenderer>().as <ARenderer>().singleInstance ();
69
88
auto outputPath =
70
89
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" );
72
91
taskBuilder.addRegistrations (installFramework (width, height, outputPath));
73
92
taskBuilder.addRegistrations (installSceneSetup (sceneSetup, " ." , Cloud::Rendering::Mode::SunAndSkyAllScatter, Cloud::Model::Mipmaps::On));
74
93
taskBuilder.addRegistrations (installApp ());
@@ -80,8 +99,14 @@ namespace DeepestScatter
80
99
81
100
return container;
82
101
};
102
+ }
103
+
104
+ std::queue<GuiExecutionLoop::LazyTask> Tasks::renderCloud (const std::string &cloudPath, float sizeM)
105
+ {
106
+ std::queue<GuiExecutionLoop::LazyTask> tasks;
83
107
84
- tasks.push (task);
108
+ tasks.push (renderCloudSingleTask (cloudPath, sizeM, LightDirection::Side));
109
+ tasks.push (renderCloudSingleTask (cloudPath, sizeM, LightDirection::Back));
85
110
86
111
return tasks;
87
112
}
0 commit comments