MinRenderingResolution
MinRenderingResolution
#Overview
name: MinRenderingResolution
The value of this variable can be defined or overridden in .ini config files. 1
.ini config file referencing this setting variable.
It is referenced in 6
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of MinRenderingResolution is to set a lower bound for the rendering resolution in Unreal Engine 5’s screen percentage system. This variable is part of the engine’s rendering and optimization features, specifically related to dynamic resolution scaling.
This setting variable is primarily used in the Engine module, particularly within the legacy screen percentage driver system. It’s referenced in the FStaticResolutionFractionHeuristic class, which is responsible for managing and applying screen percentage settings.
The value of MinRenderingResolution is typically set from a console variable (CVar) named CVarScreenPercentageMinResolution. It’s pulled from this CVar in the PullRunTimeRenderingSettings function of the FStaticResolutionFractionHeuristic::FUserSettings class.
MinRenderingResolution interacts closely with other screen percentage-related variables, such as MaxRenderingResolution and GlobalResolutionFraction. It’s used to ensure that the rendering resolution doesn’t drop below a certain threshold, even when dynamic resolution scaling is in effect.
Developers should be aware that this variable is crucial for maintaining visual quality in scenarios where performance optimization might otherwise reduce the resolution too far. It prevents the game from rendering at extremely low resolutions that could severely impact visual fidelity.
Best practices when using this variable include:
- Setting it to a value that represents the lowest acceptable rendering resolution for your game.
- Considering the target platforms and their typical display resolutions when choosing this value.
- Testing thoroughly to ensure that the minimum resolution still provides acceptable visual quality across different scenarios in your game.
- Balancing this setting with performance requirements, as setting it too high might prevent necessary performance optimizations on lower-end hardware.
- Considering this setting in conjunction with MaxRenderingResolution to define an appropriate range for dynamic resolution scaling.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseEngine.ini:2021, section: [Rendering.AutoScreenPercentage]
- INI Section:
Rendering.AutoScreenPercentage
- Raw value:
720
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/LegacyScreenPercentageDriver.cpp:213
Scope (from outer to inner):
file
function void FStaticResolutionFractionHeuristic::FUserSettings::PullRunTimeRenderingSettings
Source code excerpt:
{
float GlobalResolutionFractionOverride = GetResolutionFraction(CVarScreenPercentage.GetValueOnGameThread());
MinRenderingResolution = CVarScreenPercentageMinResolution.GetValueOnGameThread();
MaxRenderingResolution = CVarScreenPercentageMaxResolution.GetValueOnGameThread();
if (GlobalResolutionFractionOverride > 0.0)
{
Mode = EScreenPercentageMode::Manual;
GlobalResolutionFraction = GlobalResolutionFractionOverride;
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/LegacyScreenPercentageDriver.cpp:259
Scope (from outer to inner):
file
function void FStaticResolutionFractionHeuristic::FUserSettings::PullRunTimeRenderingSettings
Source code excerpt:
Mode = EScreenPercentageMode::Manual;
GlobalResolutionFraction = GetResolutionFraction(CVarScreenPercentage.GetValueOnGameThread());
MinRenderingResolution = CVarScreenPercentageMinResolution.GetValueOnGameThread();
MaxRenderingResolution = CVarScreenPercentageMaxResolution.GetValueOnGameThread();
AutoPixelCountMultiplier = CVarAutoPixelCountMultiplier.GetValueOnGameThread();
if (GlobalResolutionFraction <= 0.0)
{
GlobalResolutionFraction = 1.0f;
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/LegacyScreenPercentageDriver.cpp:307
Scope: file
Source code excerpt:
}
GlobalResolutionFraction = GetResolutionFraction(CVarEditorViewportDefaultScreenPercentage->GetInt());
MinRenderingResolution = CVarEditorViewportDefaultMinRenderingResolution->GetInt();
MaxRenderingResolution = CVarEditorViewportDefaultMaxRenderingResolution->GetInt();
}
#else
{
unimplemented();
}
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/LegacyScreenPercentageDriver.cpp:373
Scope (from outer to inner):
file
function float FStaticResolutionFractionHeuristic::ResolveResolutionFraction
Source code excerpt:
bSuccess = bSuccess && GConfig->GetFloat(TEXT("Rendering.AutoScreenPercentage"), TEXT("MidDisplayResolution"), AutoMidDisplayResolution, GEngineIni);
bSuccess = bSuccess && GConfig->GetFloat(TEXT("Rendering.AutoScreenPercentage"), TEXT("MaxDisplayResolution"), AutoMaxDisplayResolution, GEngineIni);
bSuccess = bSuccess && GConfig->GetFloat(TEXT("Rendering.AutoScreenPercentage"), TEXT("MinRenderingResolution"), AutoMinRenderingResolution, GEngineIni);
bSuccess = bSuccess && GConfig->GetFloat(TEXT("Rendering.AutoScreenPercentage"), TEXT("MidRenderingResolution"), AutoMidRenderingResolution, GEngineIni);
bSuccess = bSuccess && GConfig->GetFloat(TEXT("Rendering.AutoScreenPercentage"), TEXT("MaxRenderingResolution"), AutoMaxRenderingResolution, GEngineIni);
if (!bSuccess)
{
UE_LOG(LogEngine, Fatal, TEXT("Failed to load Rendering.AutoScreenPercentage ini section."));
}
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/LegacyScreenPercentageDriver.cpp:433
Scope (from outer to inner):
file
function float FStaticResolutionFractionHeuristic::ResolveResolutionFraction
Source code excerpt:
// Min the rendering resolution to avoid any upscaling at very low resolutions.
const float MinRenderingPixelCount = GetRenderingPixelCount(Settings.MinRenderingResolution);
if (MinRenderingPixelCount > 0.0f)
{
float MinGlobalResolutionFraction = FMath::Min(FMath::Sqrt(float(MinRenderingPixelCount) / float(LocalTotalDisplayedPixelCount)), 1.0f);
GlobalResolutionFraction = FMath::Max(GlobalResolutionFraction, MinGlobalResolutionFraction);
}
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/LegacyScreenPercentageDriver.h:94
Scope: file
Source code excerpt:
// r.ScreenPercentage.{Min,Max}Resolution
float MinRenderingResolution = 0.0f;
float MaxRenderingResolution = 0.0f;
// r.ScreenPercentage.Auto.* Mode = EMode::BasedOnDisplayResolution.
float AutoPixelCountMultiplier = 1.0f;
// stereo HMDs cannot use percentage modes based on 2D monitor