From a58ea86318bd236d3b02c65cd715f86cfed1a225 Mon Sep 17 00:00:00 2001 From: Lubos Date: Fri, 25 Nov 2022 09:18:16 +0100 Subject: [PATCH] OpenXR - HUD scale option added --- Core/Config.cpp | 1 + Core/Config.h | 1 + GPU/GLES/ShaderManagerGLES.cpp | 5 ++--- UI/GameSettingsScreen.cpp | 1 + 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Core/Config.cpp b/Core/Config.cpp index 35a05ba910..5ba047389d 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -1214,6 +1214,7 @@ static ConfigSetting vrSettings[] = { ConfigSetting("VRCameraSide", &g_Config.fCameraSide, 0.0f), ConfigSetting("VRCanvasDistance", &g_Config.fCanvasDistance, 6.0f), ConfigSetting("VRFieldOfView", &g_Config.fFieldOfViewPercentage, 100.0f), + ConfigSetting("VRHeadUpDidplayScale", &g_Config.fHeadUpDidplayScale, 0.5f), ConfigSetting("VRMotionLength", &g_Config.fMotionLength, 0.5f), ConfigSetting(false), diff --git a/Core/Config.h b/Core/Config.h index af20f6289e..e99db82d10 100644 --- a/Core/Config.h +++ b/Core/Config.h @@ -471,6 +471,7 @@ public: float fCameraSide; float fCanvasDistance; float fFieldOfViewPercentage; + float fHeadUpDidplayScale; float fMotionLength; // Debugger diff --git a/GPU/GLES/ShaderManagerGLES.cpp b/GPU/GLES/ShaderManagerGLES.cpp index 446413014e..5458342ad9 100644 --- a/GPU/GLES/ShaderManagerGLES.cpp +++ b/GPU/GLES/ShaderManagerGLES.cpp @@ -392,9 +392,8 @@ void LinkedShader::UpdateUniforms(u32 vertType, const ShaderID &vsid, bool useBu !gstate.isFogEnabled() && //2D content cannot be rendered with fog on !gstate.isDepthWriteEnabled(); //This breaks minimap in GTA but works elsewhere if (hud) { - float scale = 0.5f; - render_->SetUniformF1(&u_scaleX, scale); - render_->SetUniformF1(&u_scaleY, scale / 480.0f * 272.0f); + render_->SetUniformF1(&u_scaleX, g_Config.fHeadUpDidplayScale); + render_->SetUniformF1(&u_scaleY, g_Config.fHeadUpDidplayScale / 480.0f * 272.0f); } else { render_->SetUniformF1(&u_scaleX, 1.0f); render_->SetUniformF1(&u_scaleY, 1.0f); diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index ef7d5b6c3a..f444c0e23c 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -1103,6 +1103,7 @@ void GameSettingsScreen::CreateViews() { vrSettings->Add(new ItemHeader(vr->T("VR camera"))); vrSettings->Add(new PopupSliderChoiceFloat(&g_Config.fCanvasDistance, 1.0f, 15.0f, vr->T("Distance to 2D menus and scenes"), 1.0f, screenManager(), "")); vrSettings->Add(new PopupSliderChoiceFloat(&g_Config.fFieldOfViewPercentage, 100.0f, 200.0f, vr->T("Field of view scale"), 10.0f, screenManager(), vr->T("% of native FoV"))); + vrSettings->Add(new PopupSliderChoiceFloat(&g_Config.fHeadUpDidplayScale, 0.2f, 1.0f, vr->T("Head up display scale"), 0.1f, screenManager(), "")); vrSettings->Add(new ItemHeader(vr->T("VR controllers"))); vrSettings->Add(new CheckBox(&g_Config.bEnableMotions, vr->T("Map controller movements to keys")));