| 54 | } |
| 55 | |
| 56 | bool SamplerWindow::DrawObjectGUI(Properties &props, bool &modifiedProps) { |
| 57 | //-------------------------------------------------------------------------- |
| 58 | // sampler.type |
| 59 | //-------------------------------------------------------------------------- |
| 60 | |
| 61 | const string currentSamplerType = props.Get(Property("sampler.type")(typeTable.GetDefaultTag())).Get<string>(); |
| 62 | int typeIndex = typeTable.GetVal(currentSamplerType); |
| 63 | if (ImGui::Combo("Sampler type", &typeIndex, typeTable.GetTagList())) { |
| 64 | props.Clear(); |
| 65 | |
| 66 | props << Property("sampler.type")(typeTable.GetTag(typeIndex)); |
| 67 | |
| 68 | return true; |
| 69 | } |
| 70 | ImGui::SameLine(); |
| 71 | ImGui::TextDisabled("(?)"); |
| 72 | if (ImGui::IsItemHovered()) |
| 73 | ImGui::SetTooltip("sampler.type"); |
| 74 | |
| 75 | //-------------------------------------------------------------------------- |
| 76 | // RANDOM |
| 77 | //-------------------------------------------------------------------------- |
| 78 | |
| 79 | if (typeIndex == typeTable.GetVal("RANDOM")) { |
| 80 | float fval = props.Get("sampler.random.adaptive.strength").Get<float>(); |
| 81 | if (ImGui::SliderFloat("Adaptive strength", &fval, 0.f, .95f)) { |
| 82 | props.Set(Property("sampler.random.adaptive.strength")(fval)); |
| 83 | modifiedProps = true; |
| 84 | } |
| 85 | LuxCoreApp::HelpMarker("sampler.random.adaptive.strength"); |
| 86 | } |
| 87 | |
| 88 | //-------------------------------------------------------------------------- |
| 89 | // SOBOL |
| 90 | //-------------------------------------------------------------------------- |
| 91 | |
| 92 | if (typeIndex == typeTable.GetVal("SOBOL")) { |
| 93 | float fval = props.Get("sampler.sobol.adaptive.strength").Get<float>(); |
| 94 | if (ImGui::SliderFloat("Adaptive strength", &fval, 0.f, .95f)) { |
| 95 | props.Set(Property("sampler.sobol.adaptive.strength")(fval)); |
| 96 | modifiedProps = true; |
| 97 | } |
| 98 | LuxCoreApp::HelpMarker("sampler.sobol.adaptive.strength"); |
| 99 | } |
| 100 | |
| 101 | //-------------------------------------------------------------------------- |
| 102 | // METROPOLIS |
| 103 | //-------------------------------------------------------------------------- |
| 104 | |
| 105 | if (typeIndex == typeTable.GetVal("METROPOLIS")) { |
| 106 | int ival; |
| 107 | float fval; |
| 108 | |
| 109 | fval = props.Get("sampler.metropolis.largesteprate").Get<float>(); |
| 110 | if (ImGui::SliderFloat("Large step rate", &fval, 0.f, 1.f)) { |
| 111 | props.Set(Property("sampler.metropolis.largesteprate")(fval)); |
| 112 | modifiedProps = true; |
| 113 | } |
nothing calls this directly
no test coverage detected