| 38 | struct Tutorial : public SceneLoadingTutorialApplication |
| 39 | { |
| 40 | Tutorial() |
| 41 | : SceneLoadingTutorialApplication(NAME,FEATURES) |
| 42 | { |
| 43 | registerOption("single_pass", [] (Ref<ParseStream> cin, const FileName& path) { |
| 44 | g_next_hit_mode = SINGLE_PASS; |
| 45 | }, "--single_pass: use special all hits kernel to gather all hits along ray"); |
| 46 | |
| 47 | registerOption("multi_pass_fixed_next_hits", [] (Ref<ParseStream> cin, const FileName& path) { |
| 48 | g_next_hit_mode = MULTI_PASS_FIXED_NEXT_HITS; |
| 49 | }, "--multi_pass_fixed_next_hits: use multiple passes and gather a fixed number of hits each pass"); |
| 50 | |
| 51 | registerOption("multi_pass_optimal_next_hits", [] (Ref<ParseStream> cin, const FileName& path) { |
| 52 | g_next_hit_mode = MULTI_PASS_OPTIMAL_NEXT_HITS; |
| 53 | }, "--multi_pass_optimal_next_hits: use multiple passes and gather the optimal number of hits (known from previous frame)"); |
| 54 | |
| 55 | registerOption("multi_pass_estimate_next_hits", [] (Ref<ParseStream> cin, const FileName& path) { |
| 56 | g_next_hit_mode = MULTI_PASS_ESTIMATED_NEXT_HITS; |
| 57 | }, "--multi_pass_estimate_next_hits: use multiple passes and estimate the number of hits to gather from opacity"); |
| 58 | |
| 59 | registerOption("max_next_hits", [] (Ref<ParseStream> cin, const FileName& path) { |
| 60 | g_max_next_hits = cin->getInt(); |
| 61 | }, "--max_next_hits <int>: sets maximal number of hits to accumulate in each pass"); |
| 62 | |
| 63 | registerOption("max_total_hits", [] (Ref<ParseStream> cin, const FileName& path) { |
| 64 | g_max_total_hits = cin->getInt(); |
| 65 | if (g_max_total_hits > 16*1024) |
| 66 | throw std::runtime_error("max_total_hits too large"); |
| 67 | }, "--max_total_hits <int>: sets maximal number of hits to accumulate in total"); |
| 68 | |
| 69 | registerOption("curve_opacity", [] (Ref<ParseStream> cin, const FileName& path) { |
| 70 | g_enable_opacity = true; |
| 71 | g_curve_opacity = cin->getFloat(); |
| 72 | }, "--curve_opacity <float>: specifies opacity for curves, make surfaces opaque, enables stop at opaque surface, and enables roussian roulette ray termination"); |
| 73 | |
| 74 | registerOption("verify", [] (Ref<ParseStream> cin, const FileName& path) { |
| 75 | g_verify = true; |
| 76 | }, "--verify: verifies result of collecting all hits"); |
| 77 | |
| 78 | registerOption("visualize_errors", [] (Ref<ParseStream> cin, const FileName& path) { |
| 79 | g_visualize_errors = true; |
| 80 | }, "--visualize_errors: visualizes pixels where collected hits are wrong"); |
| 81 | } |
| 82 | |
| 83 | void postParseCommandLine() override |
| 84 | { |