Enable upscaling for up to 8x SSAA

This commit is contained in:
Edward Li 2020-01-30 03:26:09 +08:00
parent a45bd364ba
commit 1d72f66de9
2 changed files with 48 additions and 4 deletions

View File

@ -827,7 +827,7 @@ void LoadSettings(bool game_specific)
settings.rend.CustomTextures = cfgLoadBool(config_section, "rend.CustomTextures", settings.rend.CustomTextures);
settings.rend.DumpTextures = cfgLoadBool(config_section, "rend.DumpTextures", settings.rend.DumpTextures);
settings.rend.ScreenScaling = cfgLoadInt(config_section, "rend.ScreenScaling", settings.rend.ScreenScaling);
settings.rend.ScreenScaling = min(max(1, settings.rend.ScreenScaling), 100);
settings.rend.ScreenScaling = min(max(1, settings.rend.ScreenScaling), 800);
settings.rend.ScreenStretching = cfgLoadInt(config_section, "rend.ScreenStretching", settings.rend.ScreenStretching);
settings.rend.Fog = cfgLoadBool(config_section, "rend.Fog", settings.rend.Fog);
settings.rend.FloatVMUs = cfgLoadBool(config_section, "rend.FloatVMUs", settings.rend.FloatVMUs);

View File

@ -1036,9 +1036,53 @@ static void gui_display_settings()
ImGui::Checkbox("Use Vulkan Renderer", &vulkan);
ImGui::SameLine();
ShowHelpMarker("Use Vulkan instead of Open GL/GLES. Experimental");
ImGui::SliderInt("Scaling", (int *)&settings.rend.ScreenScaling, 1, 100);
ImGui::SameLine();
ShowHelpMarker("Downscaling factor relative to native screen resolution. Higher is better");
const map<int, const char*> scalings { { 10, "0.1"}, { 20, "0.2" }, { 30, "0.3" }, { 40, "0.4" }, { 50, "0.5" }, { 60, "0.6" }, { 70, "0.7" }, { 80, "0.8" }, { 90, "0.9" }, { 100, "1.0 (Native)" }, { 200, "2.0 (2x SSAA)" }, { 300, "3.0 (3x SSAA)" }, { 400, "4.0 (4x SSAA)" }, { 600, "6.0 (6x SSAA)" }, { 800, "8.0 (8x SSAA)" }
};
if ( scalings.count(settings.rend.ScreenScaling == 0) )
settings.rend.ScreenScaling = 100;
auto scalings_it = scalings.find(settings.rend.ScreenScaling);
ImGuiStyle& scaling_style = ImGui::GetStyle();
float scaling_spacing = scaling_style.ItemInnerSpacing.x;
ImGui::PushItemWidth(ImGui::CalcItemWidth() - scaling_spacing * 2.0f - ImGui::GetFrameHeight() * 2.0f);
if (ImGui::BeginCombo("##Scaling", scalings.at(settings.rend.ScreenScaling), ImGuiComboFlags_NoArrowButton))
{
for(auto& kv: scalings) {
bool is_selected = (kv.first == settings.rend.ScreenScaling);
if (ImGui::Selectable(kv.second, is_selected))
{
settings.rend.ScreenScaling = kv.first;
}
if (is_selected)
ImGui::SetItemDefaultFocus();
}
ImGui::EndCombo();
}
ImGui::PopItemWidth();
ImGui::SameLine(0, scaling_spacing);
if (ImGui::ArrowButton("##Decrease Scaling", ImGuiDir_Left))
{
if ( scalings_it != scalings.begin() ){
settings.rend.ScreenScaling = (--scalings_it)->first;
}
}
ImGui::SameLine(0, scaling_spacing);
if (ImGui::ArrowButton("##Increase Scaling", ImGuiDir_Right))
{
if ( scalings_it != (--scalings.end()) ){
settings.rend.ScreenScaling = (++scalings_it)->first;
}
}
ImGui::SameLine(0, scaling_style.ItemInnerSpacing.x);
ImGui::Text("Scaling (SSAA)");
ImGui::SameLine();
ShowHelpMarker("Downscaling/Upscaling factor relative to native screen resolution. Higher is better but more demanding");
ImGui::SliderInt("Horizontal Stretching", (int *)&settings.rend.ScreenStretching, 100, 150);
ImGui::SameLine();
ShowHelpMarker("Stretch the screen horizontally");