Skip to content

Commit 130bbc6

Browse files
committed
Show exact resolution and add 1.5x multiplier
1 parent 5d3d8a6 commit 130bbc6

3 files changed

Lines changed: 33 additions & 14 deletions

File tree

launcher/main.cpp

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -688,25 +688,31 @@ static bool InstallDownloadedGraphicsOverride(const LauncherPaths& paths, const
688688
bool replacedAny = false;
689689
if (probeResult.leftWidth != 0 && probeResult.leftHeight != 0) {
690690
struct BetterVRPresetPlaceholder {
691+
const char* nameToken;
691692
const char* widthToken;
692693
const char* heightToken;
693694
double multiplier;
694-
const char* label;
695+
const char* multiplierLabel;
695696
};
696697

697698
static constexpr BetterVRPresetPlaceholder PresetPlaceholders[] = {
698-
{ "__BETTERVR_05_WIDTH__", "__BETTERVR_05_HEIGHT__", 0.5, "0.5x" },
699-
{ "__BETTERVR_10_WIDTH__", "__BETTERVR_10_HEIGHT__", 1.0, "1x" },
700-
{ "__BETTERVR_20_WIDTH__", "__BETTERVR_20_HEIGHT__", 2.0, "2x" },
701-
{ "__BETTERVR_30_WIDTH__", "__BETTERVR_30_HEIGHT__", 3.0, "3x" },
702-
{ "__BETTERVR_40_WIDTH__", "__BETTERVR_40_HEIGHT__", 4.0, "4x" },
699+
{ "__BETTERVR_05_NAME__", "__BETTERVR_05_WIDTH__", "__BETTERVR_05_HEIGHT__", 0.5, "0.5x" },
700+
{ "__BETTERVR_10_NAME__", "__BETTERVR_10_WIDTH__", "__BETTERVR_10_HEIGHT__", 1.0, "1x" },
701+
{ "__BETTERVR_15_NAME__", "__BETTERVR_15_WIDTH__", "__BETTERVR_15_HEIGHT__", 1.5, "1.5x" },
702+
{ "__BETTERVR_20_NAME__", "__BETTERVR_20_WIDTH__", "__BETTERVR_20_HEIGHT__", 2.0, "2x" },
703+
{ "__BETTERVR_30_NAME__", "__BETTERVR_30_WIDTH__", "__BETTERVR_30_HEIGHT__", 3.0, "3x" },
704+
{ "__BETTERVR_40_NAME__", "__BETTERVR_40_WIDTH__", "__BETTERVR_40_HEIGHT__", 4.0, "4x" },
703705
};
704706

705707
for (const BetterVRPresetPlaceholder& preset : PresetPlaceholders) {
706708
const std::pair<uint32_t, uint32_t> adjustedResolution = GetNearestRulesCompatibleEyeResolution(double(probeResult.leftWidth) * preset.multiplier, double(probeResult.leftHeight) * preset.multiplier);
707-
LogLine("Adjusted BetterVR " + std::string(preset.label) + " resolution: " + std::to_string(adjustedResolution.first) + "x" + std::to_string(adjustedResolution.second));
708-
replacedAny |= ReplaceTextToken(contents, preset.widthToken, std::to_string(adjustedResolution.first));
709-
replacedAny |= ReplaceTextToken(contents, preset.heightToken, std::to_string(adjustedResolution.second));
709+
const std::string adjustedWidth = std::to_string(adjustedResolution.first);
710+
const std::string adjustedHeight = std::to_string(adjustedResolution.second);
711+
const std::string resolutionLabel = adjustedWidth + "x" + adjustedHeight;
712+
LogLine("Adjusted BetterVR " + std::string(preset.multiplierLabel) + " resolution: " + resolutionLabel);
713+
replacedAny |= ReplaceTextToken(contents, preset.nameToken, resolutionLabel);
714+
replacedAny |= ReplaceTextToken(contents, preset.widthToken, adjustedWidth);
715+
replacedAny |= ReplaceTextToken(contents, preset.heightToken, adjustedHeight);
710716
}
711717
}
712718

resources/BreathOfTheWild_Graphics/rules.txt

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,32 +33,38 @@ $enableUltrawideDebugLogging:int = 0
3333
# VR Resolution Multiplier (BetterVR)
3434

3535
[Preset]
36-
name = 0.5x (Only For 8K VR headsets)
36+
name = __BETTERVR_05_NAME__ (0.5x, Not Recommended Except For 8K VR headsets)
3737
category = VR Resolution Multiplier
3838
$width = __BETTERVR_05_WIDTH__
3939
$height = __BETTERVR_05_HEIGHT__
4040

4141
[Preset]
42-
name = 1x (Native Headset Resolution, Default)
42+
name = __BETTERVR_10_NAME__ (1x, Native Headset Resolution, Default)
4343
category = VR Resolution Multiplier
4444
default = 1
4545
$width = __BETTERVR_10_WIDTH__
4646
$height = __BETTERVR_10_HEIGHT__
4747

4848
[Preset]
49-
name = 2x (Good For Anti-Aliasing, Recommended)
49+
name = __BETTERVR_15_NAME__ (1.5x, Balanced Quality)
50+
category = VR Resolution Multiplier
51+
$width = __BETTERVR_15_WIDTH__
52+
$height = __BETTERVR_15_HEIGHT__
53+
54+
[Preset]
55+
name = __BETTERVR_20_NAME__ (2x, Better Anti-Aliasing, Recommended)
5056
category = VR Resolution Multiplier
5157
$width = __BETTERVR_20_WIDTH__
5258
$height = __BETTERVR_20_HEIGHT__
5359

5460
[Preset]
55-
name = 3x (Best Anti-Aliasing, Requires A Good GPU)
61+
name = __BETTERVR_30_NAME__ (3x, Best Anti-Aliasing, Requires A Good GPU)
5662
category = VR Resolution Multiplier
5763
$width = __BETTERVR_30_WIDTH__
5864
$height = __BETTERVR_30_HEIGHT__
5965

6066
[Preset]
61-
name = 4x (Likely Costs Performance)
67+
name = __BETTERVR_40_NAME__ (4x, Likely Costs Performance)
6268
category = VR Resolution Multiplier
6369
$width = __BETTERVR_40_WIDTH__
6470
$height = __BETTERVR_40_HEIGHT__

src/utils/logger.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,13 @@ struct std::formatter<BESeadLookAtCamera> : std::formatter<string> {
174174
}
175175
};
176176

177+
template <>
178+
struct std::formatter<LookAtMatrix> : std::formatter<string> {
179+
auto format(const LookAtMatrix& cam, std::format_context& ctx) const {
180+
return std::format_to(ctx.out(), "pos = {}, target = {}, up = {}, unknown = {}, zNear = {}, zFar = {}", cam.pos, cam.target, cam.up, cam.unknown, cam.zNear.getLE(), cam.zFar.getLE());
181+
}
182+
};
183+
177184

178185
template <>
179186
struct std::formatter<D3D_FEATURE_LEVEL> : std::formatter<string> {

0 commit comments

Comments
 (0)