r.ScreenPercentage.MinResolution

r.ScreenPercentage.MinResolution

#Overview

name: r.ScreenPercentage.MinResolution

This variable is created as a Console Variable (cvar).

It is referenced in 4 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of r.ScreenPercentage.MinResolution is to control the absolute minimum number of rendered pixels in the Unreal Engine’s rendering system. This setting variable is part of the screen percentage and resolution scaling functionality.

This setting variable is primarily used in the Engine module, specifically within the legacy screen percentage driver. It’s part of the rendering subsystem that handles dynamic resolution scaling.

The value of this variable is set through the console variable system in Unreal Engine. It’s defined as a TAutoConsoleVariable with a default value of 0.0f.

The associated variable CVarScreenPercentageMinResolution interacts directly with r.ScreenPercentage.MinResolution. They share the same value and are used interchangeably in the code.

Developers must be aware that this variable sets a lower bound for the rendering resolution. It’s crucial for maintaining a minimum level of visual quality while allowing for dynamic resolution scaling.

Best practices when using this variable include:

  1. Setting it to a value that ensures a minimum acceptable visual quality for your game.
  2. Considering the target hardware capabilities when setting this value.
  3. Testing thoroughly across different device specifications to ensure the minimum resolution doesn’t impact gameplay negatively.

Regarding the associated variable CVarScreenPercentageMinResolution:

The purpose of CVarScreenPercentageMinResolution is the same as r.ScreenPercentage.MinResolution - to control the minimum number of rendered pixels.

It’s used in the Engine module, specifically in the LegacyScreenPercentageDriver.

The value is set when the console variable is initialized and can be accessed through the GetValueOnGameThread() method.

This variable interacts with other screen percentage-related variables like CVarScreenPercentageMaxResolution and CVarScreenPercentage.

Developers should be aware that this variable is used in the FStaticResolutionFractionHeuristic::FUserSettings class to pull runtime rendering settings.

Best practices include using this variable in conjunction with other screen percentage settings to create a balanced dynamic resolution system that maintains performance without overly sacrificing visual quality.

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/LegacyScreenPercentageDriver.cpp:46

Scope: file

Source code excerpt:


static TAutoConsoleVariable<float> CVarScreenPercentageMinResolution(
	TEXT("r.ScreenPercentage.MinResolution"),
	0.0f,
	TEXT("Controls the absolute minimum number of rendered pixel."),
	ECVF_Default);

static TAutoConsoleVariable<float> CVarScreenPercentageMaxResolution(
	TEXT("r.ScreenPercentage.MaxResolution"),

#Associated Variable and Callsites

This variable is associated with another variable named CVarScreenPercentageMinResolution. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/LegacyScreenPercentageDriver.cpp:45

Scope: file

Source code excerpt:

	ECVF_Default);

static TAutoConsoleVariable<float> CVarScreenPercentageMinResolution(
	TEXT("r.ScreenPercentage.MinResolution"),
	0.0f,
	TEXT("Controls the absolute minimum number of rendered pixel."),
	ECVF_Default);

static TAutoConsoleVariable<float> CVarScreenPercentageMaxResolution(

#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;