MCPcopy Create free account
hub / github.com/RenderKit/embree / Tutorial

Class Tutorial

tutorials/pathtracer/pathtracer.cpp:23–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21 }
22
23 struct Tutorial : public SceneLoadingTutorialApplication
24 {
25 Tutorial()
26 : SceneLoadingTutorialApplication(NAME,FEATURES)
27 {
28 registerOption("spp", [] (Ref<ParseStream> cin, const FileName& path) {
29 g_spp = cin->getInt();
30 }, "--spp <int>: sets number of samples per pixel");
31
32 registerOption("max-path-length", [] (Ref<ParseStream> cin, const FileName& path) {
33 g_max_path_length = cin->getInt();
34 }, "--max-path-length <int>: sets maximal path length (1=primary+shadow)");
35
36 registerOption("accumulate", [] (Ref<ParseStream> cin, const FileName& path) {
37 g_accumulate = cin->getInt();
38 }, "--accumulate <bool>: accumulate samples (on by default)");
39 }
40
41 void postParseCommandLine() override
42 {
43 /* load default scene if none specified */
44 if (scene_empty_post_parse()) {
45 FileName file = FileName::executableFolder() + FileName("models/cornell_box.ecs");
46 parseCommandLine(new ParseStream(new LineCommentFilter(file, "#")), file.path());
47 }
48 }
49
50#if defined(USE_GLFW)
51 void drawGUI() override
52 {
53 ImGui::Checkbox("accumulate",&g_accumulate);
54 ImGui::Text("max path length");
55 ImGui::DragInt("##max_path_length",&g_max_path_length,1.0f,1,16);
56 ImGui::Text("samples per pixel");
57 ImGui::DragInt("##samples per pixel",&g_spp,1.0f,1,16);
58 }
59#endif
60 };
61
62}
63

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected