r.Editor.Viewport.MinRenderingResolution

r.Editor.Viewport.MinRenderingResolution

#Overview

name: r.Editor.Viewport.MinRenderingResolution

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

It is referenced in 7 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of r.Editor.Viewport.MinRenderingResolution is to control the minimum number of rendered pixels by default in Unreal Engine editor viewports. This setting variable is primarily used for managing the rendering resolution in the editor environment.

This setting variable is mainly utilized by the Unreal Engine’s editor subsystem, specifically in the viewport rendering module. It’s referenced in the UnrealEd and Engine modules, as seen in the provided source code locations.

The value of this variable is set in multiple places:

  1. It’s initially set with a default value of 720 in the EditorProjectSettings.cpp file.
  2. It can be updated through project settings via the ExportResolutionValuesToConsoleVariables function in EditorProjectSettings.cpp.
  3. It can be overridden by editor user settings, also in the ExportResolutionValuesToConsoleVariables function.

This variable interacts closely with other related variables, such as r.Editor.Viewport.MaxRenderingResolution, r.Editor.Viewport.ScreenPercentage, and r.Editor.Viewport.ScreenPercentageMode.NonRealTime. These variables work together to control the rendering resolution and screen percentage in the editor viewports.

Developers should be aware that this variable sets a lower bound for rendering resolution in the editor. It’s important to balance this setting with performance considerations, especially for less powerful development machines.

Best practices when using this variable include:

  1. Setting it to a value that provides a good balance between visual quality and performance in the editor.
  2. Considering the target platforms and typical development machine specifications when choosing a value.
  3. Using it in conjunction with the max rendering resolution setting to define an appropriate range for viewport rendering.

Regarding the associated variable CVarEditorViewportDefaultMinRenderingResolution:

This is the actual console variable object that represents r.Editor.Viewport.MinRenderingResolution in the code. It’s created as a TAutoConsoleVariable and is used to interact with the setting value programmatically.

The purpose of this variable is the same as r.Editor.Viewport.MinRenderingResolution, but it provides the interface for the engine to read and modify the value at runtime.

This variable is used in the LegacyScreenPercentageDriver.cpp file to retrieve the current minimum rendering resolution value. It’s also used in the ExportResolutionValuesToConsoleVariables function to update the value based on project or user settings.

Developers should be aware that modifying this variable directly will affect the minimum rendering resolution in the editor viewports. It’s generally better to modify this through the proper editor settings interfaces rather than changing the console variable directly, to ensure consistency across the engine’s systems.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Settings/EditorProjectSettings.cpp:41

Scope: file

Source code excerpt:


TAutoConsoleVariable<int32> CVarEditorViewportDefaultMinRenderingResolution(
	TEXT("r.Editor.Viewport.MinRenderingResolution"), 720,
	TEXT("Controls the minimum number of rendered pixel by default in editor viewports."),
	ECVF_Default);

TAutoConsoleVariable<int32> CVarEditorViewportDefaultMaxRenderingResolution(
	TEXT("r.Editor.Viewport.MaxRenderingResolution"), 2160,
	TEXT("Controls the absolute maximum number of rendered pixel in editor viewports."),

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

Scope: file

Source code excerpt:

	static auto CVarEditorViewportDefaultScreenPercentageMode = IConsoleManager::Get().FindConsoleVariable(TEXT("r.Editor.Viewport.ScreenPercentageMode.NonRealTime"));
	static auto CVarEditorViewportDefaultScreenPercentage = IConsoleManager::Get().FindConsoleVariable(TEXT("r.Editor.Viewport.ScreenPercentage"));
	static auto CVarEditorViewportDefaultMinRenderingResolution = IConsoleManager::Get().FindConsoleVariable(TEXT("r.Editor.Viewport.MinRenderingResolution"));
	static auto CVarEditorViewportDefaultMaxRenderingResolution = IConsoleManager::Get().FindConsoleVariable(TEXT("r.Editor.Viewport.MaxRenderingResolution"));

	if (ViewStatus == EViewStatusForScreenPercentage::PathTracer)
	{
		Mode = EScreenPercentageMode(FMath::Clamp(CVarEditorViewportDefaultScreenPercentagePathTracerMode->GetInt(), 0, 2));
	}

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Settings/EditorProjectSettings.cpp:40

Scope: file

Source code excerpt:

	ECVF_Default);

TAutoConsoleVariable<int32> CVarEditorViewportDefaultMinRenderingResolution(
	TEXT("r.Editor.Viewport.MinRenderingResolution"), 720,
	TEXT("Controls the minimum number of rendered pixel by default in editor viewports."),
	ECVF_Default);

TAutoConsoleVariable<int32> CVarEditorViewportDefaultMaxRenderingResolution(
	TEXT("r.Editor.Viewport.MaxRenderingResolution"), 2160,

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Settings/EditorProjectSettings.cpp:296

Scope (from outer to inner):

file
function     void UEditorPerformanceProjectSettings::ExportResolutionValuesToConsoleVariables

Source code excerpt:

		CVarEditorViewportNonRealtimeDefaultScreenPercentageMode->Set(int32(EditorProjectSettings->NonRealtimeScreenPercentageMode), ECVF_SetByProjectSetting);
		CVarEditorViewportDefaultScreenPercentage->Set(EditorProjectSettings->ManualScreenPercentage, ECVF_SetByProjectSetting);
		CVarEditorViewportDefaultMinRenderingResolution->Set(EditorProjectSettings->MinViewportRenderingResolution, ECVF_SetByProjectSetting);
		CVarEditorViewportDefaultMaxRenderingResolution->Set(EditorProjectSettings->MaxViewportRenderingResolution, ECVF_SetByProjectSetting);
	}


	// Override with the per editor user settings
	{

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Settings/EditorProjectSettings.cpp:335

Scope (from outer to inner):

file
function     void UEditorPerformanceProjectSettings::ExportResolutionValuesToConsoleVariables

Source code excerpt:

		if (EditorUserSettings->bOverrideMinViewportRenderingResolution)
		{
			CVarEditorViewportDefaultMinRenderingResolution->Set(EditorUserSettings->MinViewportRenderingResolution, ECVF_SetByProjectSetting);
		}

		if (EditorUserSettings->bOverrideMaxViewportRenderingResolution)
		{
			CVarEditorViewportDefaultMaxRenderingResolution->Set(EditorUserSettings->MaxViewportRenderingResolution, ECVF_SetByProjectSetting);
		}

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

Scope: file

Source code excerpt:

	static auto CVarEditorViewportDefaultScreenPercentageMode = IConsoleManager::Get().FindConsoleVariable(TEXT("r.Editor.Viewport.ScreenPercentageMode.NonRealTime"));
	static auto CVarEditorViewportDefaultScreenPercentage = IConsoleManager::Get().FindConsoleVariable(TEXT("r.Editor.Viewport.ScreenPercentage"));
	static auto CVarEditorViewportDefaultMinRenderingResolution = IConsoleManager::Get().FindConsoleVariable(TEXT("r.Editor.Viewport.MinRenderingResolution"));
	static auto CVarEditorViewportDefaultMaxRenderingResolution = IConsoleManager::Get().FindConsoleVariable(TEXT("r.Editor.Viewport.MaxRenderingResolution"));

	if (ViewStatus == EViewStatusForScreenPercentage::PathTracer)
	{
		Mode = EScreenPercentageMode(FMath::Clamp(CVarEditorViewportDefaultScreenPercentagePathTracerMode->GetInt(), 0, 2));
	}

#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();
}