[ImGui] Fix fsr sharpness slider scaling
https://github.com/ocornut/imgui/issues/3361#issuecomment-1287045159
This commit is contained in:
parent
c8a39bad29
commit
29985f69e1
|
@ -399,12 +399,17 @@ void EmulatorWindow::DisplayConfigDialog::OnDraw(ImGuiIO& io) {
|
||||||
new_presenter_config.GetFsrSharpnessReduction();
|
new_presenter_config.GetFsrSharpnessReduction();
|
||||||
ImGui::TextUnformatted(
|
ImGui::TextUnformatted(
|
||||||
"FSR sharpness reduction when upscaling (lower is sharper):");
|
"FSR sharpness reduction when upscaling (lower is sharper):");
|
||||||
// Power 2.0 as the reduction is in stops, used in exp2.
|
const auto label =
|
||||||
|
fmt::format("{:.3f} stops", fsr_sharpness_reduction);
|
||||||
|
// Power 2.0 scaling as the reduction is in stops, used in exp2.
|
||||||
|
fsr_sharpness_reduction = sqrt(2.f * fsr_sharpness_reduction);
|
||||||
ImGui::SliderFloat(
|
ImGui::SliderFloat(
|
||||||
"##FSRSharpnessReduction", &fsr_sharpness_reduction,
|
"##FSRSharpnessReduction", &fsr_sharpness_reduction,
|
||||||
ui::Presenter::GuestOutputPaintConfig::kFsrSharpnessReductionMin,
|
ui::Presenter::GuestOutputPaintConfig::kFsrSharpnessReductionMin,
|
||||||
ui::Presenter::GuestOutputPaintConfig::kFsrSharpnessReductionMax,
|
ui::Presenter::GuestOutputPaintConfig::kFsrSharpnessReductionMax,
|
||||||
"%.3f stops", 2.0f);
|
label.c_str(), ImGuiSliderFlags_NoInput);
|
||||||
|
fsr_sharpness_reduction =
|
||||||
|
.5f * fsr_sharpness_reduction * fsr_sharpness_reduction;
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
if (ImGui::Button("Reset##ResetFSRSharpnessReduction")) {
|
if (ImGui::Button("Reset##ResetFSRSharpnessReduction")) {
|
||||||
fsr_sharpness_reduction = ui::Presenter::GuestOutputPaintConfig ::
|
fsr_sharpness_reduction = ui::Presenter::GuestOutputPaintConfig ::
|
||||||
|
|
Loading…
Reference in New Issue