stream resolution (foveation) config in headset

This commit is contained in:
Patrick Nicolas
2025-12-10 14:30:40 +01:00
parent b2f3b925d9
commit e0cbd202a8
4 changed files with 52 additions and 30 deletions
+23 -1
View File
@@ -642,13 +642,14 @@ void scenes::lobby::gui_settings()
imgui_ctx->vibrate_on_hover();
}
// Render resolution
{
const auto current = config.resolution_scale;
const auto width = stream_view.recommendedImageRectWidth;
const auto height = stream_view.recommendedImageRectHeight;
auto intScale = int(current * 10);
const auto slider = ImGui::SliderInt(
_("Resolution scale").append("##resolution_scale").c_str(),
_("Render resolution").append("##resolution_scale").c_str(),
&intScale,
5,
35,
@@ -667,6 +668,27 @@ void scenes::lobby::gui_settings()
}
}
// Stream resolution
{
const int step = 10;
const auto current = config.stream_scale;
auto intval = int(current * 100 / step);
const auto slider = ImGui::SliderInt(
_("Stream resolution").append("##stream_scale").c_str(),
&intval,
0,
100 / step,
fmt::format(_F("{}%%"), intval * step).c_str());
if (slider)
{
// clamp out of the slider to have the 50% value centered
intval = std::clamp(intval, 20 / step, 100 / step);
config.stream_scale = intval * step * 0.01;
config.save();
}
imgui_ctx->vibrate_on_hover();
}
if (instance.has_extension(XR_EXT_PERFORMANCE_SETTINGS_EXTENSION_NAME))
{
if (ImGui::Checkbox(_S("High power mode"), &config.high_power_mode))