1
1
#include " Tasks.h"
2
+
3
+ #include < filesystem>
4
+
2
5
#include " Util/Dataset/Dataset.h"
3
6
#include " installers.h"
4
7
#include " DisneyDescriptor.pb.h"
@@ -18,8 +21,27 @@ namespace DeepestScatter
18
21
{
19
22
namespace di = Hypodermic;
20
23
21
- uint32_t width = 512u ;
22
- uint32_t height = 256u ;
24
+ uint32_t width = 1792u ;
25
+ uint32_t height = 1024u ;
26
+
27
+ enum class LightDirection {
28
+ Front, Back, Side
29
+ };
30
+
31
+ optix::float3 getLightDirection (LightDirection direction)
32
+ {
33
+ switch (direction) {
34
+ case LightDirection::Front:
35
+ return optix::make_float3 (-0 .586f , -0 .766f , -0 .271f );
36
+ case LightDirection::Side:
37
+ return optix::make_float3 (-0 .03f , -0 .25f , 0 .8f );
38
+ case LightDirection::Back:
39
+ return optix::make_float3 (0 .586f , -0 .766f , -0 .271f );
40
+ default :
41
+ throw std::exception (" Unexpected direction" );
42
+ }
43
+
44
+ }
23
45
24
46
std::queue<GuiExecutionLoop::LazyTask> Tasks::renderCloud (const std::string &cloudPath, float sizeM)
25
47
{
@@ -32,17 +54,24 @@ namespace DeepestScatter
32
54
Persistance::SceneSetup sceneSetup{};
33
55
sceneSetup.set_cloud_path (cloudPath);
34
56
sceneSetup.set_cloud_size_m (sizeM);
35
- sceneSetup.mutable_light_direction ()->set_x (-0 .586f );
36
- sceneSetup.mutable_light_direction ()->set_y (-0 .766f );
37
- sceneSetup.mutable_light_direction ()->set_z (-0 .271f );
57
+
58
+ optix::float3 direction = getLightDirection (LightDirection::Front);
59
+ sceneSetup.mutable_light_direction ()->set_x (direction.x );
60
+ sceneSetup.mutable_light_direction ()->set_y (direction.y );
61
+ sceneSetup.mutable_light_direction ()->set_z (direction.z );
62
+
38
63
// sceneSetup.mutable_light_direction()->set_x(0.8f);
39
64
// sceneSetup.mutable_light_direction()->set_y(-0.25f);
40
65
// sceneSetup.mutable_light_direction()->set_z(0.11f);
41
66
42
- taskBuilder.addRegistrations (installFramework (width, height));
67
+ using TRenderer = BakedRenderer;
68
+ taskBuilder.registerType <TRenderer>().as <ARenderer>().singleInstance ();
69
+ auto outputPath =
70
+ std::filesystem::path (" ../../Data/Renders" ) /
71
+ std::filesystem::path (cloudPath).filename ().replace_extension (TRenderer::NAME + " .exr" );
72
+ taskBuilder.addRegistrations (installFramework (width, height, outputPath));
43
73
taskBuilder.addRegistrations (installSceneSetup (sceneSetup, " ." , Cloud::Rendering::Mode::SunAndSkyAllScatter, Cloud::Model::Mipmaps::On));
44
74
taskBuilder.addRegistrations (installApp ());
45
- taskBuilder.registerType <BakedRenderer>().as <ARenderer>().singleInstance ();
46
75
47
76
auto container = taskBuilder.build ();
48
77
@@ -76,7 +105,7 @@ namespace DeepestScatter
76
105
{
77
106
di::ContainerBuilder taskBuilder;
78
107
79
- taskBuilder.addRegistrations (installFramework (width, height));
108
+ taskBuilder.addRegistrations (installFramework (width, height, std::filesystem::path () ));
80
109
taskBuilder.addRegistrations (installSceneSetup (
81
110
sceneSetup, cloudRoot, Cloud::Rendering::Mode::SunMultipleScatter, Cloud::Model::Mipmaps::On));
82
111
taskBuilder.addRegistrations (installApp ());
0 commit comments