r.Editor.Viewport.ScreenPercentageMode.RealTime

r.Editor.Viewport.ScreenPercentageMode.RealTime

#Overview

name: r.Editor.Viewport.ScreenPercentageMode.RealTime

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

It is referenced in 10 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of r.Editor.Viewport.ScreenPercentageMode.RealTime is to control the default screen percentage mode for realtime editor viewports using the desktop renderer in Unreal Engine 5.

Regarding the associated variable CVarEditorViewportDefaultScreenPercentageMode:

#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:11

Scope: file

Source code excerpt:


TAutoConsoleVariable<int32> CVarEditorViewportDefaultScreenPercentageMode(
	TEXT("r.Editor.Viewport.ScreenPercentageMode.RealTime"), int32(EScreenPercentageMode::BasedOnDisplayResolution),
	TEXT("Controls the default screen percentage mode for realtime editor viewports using desktop renderer."),
	ECVF_Default);

TAutoConsoleVariable<int32> CVarEditorViewportDefaultMobileScreenPercentageMode(
	TEXT("r.Editor.Viewport.ScreenPercentageMode.Mobile"), int32(EScreenPercentageMode::BasedOnDPIScale),
	TEXT("Controls the default screen percentage mode for realtime editor viewports using mobile renderer."),

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/SCommonEditorViewportToolbarBase.cpp:194

Scope (from outer to inner):

file
function     static FFormatNamedArguments GetScreenPercentageFormatArguments

Source code excerpt:

static FFormatNamedArguments GetScreenPercentageFormatArguments(const FEditorViewportClient& ViewportClient)
{
	static auto CVarEditorViewportDefaultScreenPercentageRealTimeMode = IConsoleManager::Get().FindConsoleVariable(TEXT("r.Editor.Viewport.ScreenPercentageMode.RealTime"));
	static auto CVarEditorViewportDefaultScreenPercentageMobileMode = IConsoleManager::Get().FindConsoleVariable(TEXT("r.Editor.Viewport.ScreenPercentageMode.Mobile"));
	static auto CVarEditorViewportDefaultScreenPercentageVRMode = IConsoleManager::Get().FindConsoleVariable(TEXT("r.Editor.Viewport.ScreenPercentageMode.VR"));
	static auto CVarEditorViewportDefaultScreenPercentagePathTracerMode = IConsoleManager::Get().FindConsoleVariable(TEXT("r.Editor.Viewport.ScreenPercentageMode.PathTracer"));
	static auto CVarEditorViewportDefaultScreenPercentageMode = IConsoleManager::Get().FindConsoleVariable(TEXT("r.Editor.Viewport.ScreenPercentageMode.NonRealTime"));

	const UEditorPerformanceProjectSettings* EditorProjectSettings = GetDefault<UEditorPerformanceProjectSettings>();

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

Scope: file

Source code excerpt:

#if WITH_EDITOR
{
	static auto CVarEditorViewportDefaultScreenPercentageRealTimeMode = IConsoleManager::Get().FindConsoleVariable(TEXT("r.Editor.Viewport.ScreenPercentageMode.RealTime"));
	static auto CVarEditorViewportDefaultScreenPercentageMobileMode = IConsoleManager::Get().FindConsoleVariable(TEXT("r.Editor.Viewport.ScreenPercentageMode.Mobile"));
	static auto CVarEditorViewportDefaultScreenPercentageVRMode = IConsoleManager::Get().FindConsoleVariable(TEXT("r.Editor.Viewport.ScreenPercentageMode.VR"));
	static auto CVarEditorViewportDefaultScreenPercentagePathTracerMode = IConsoleManager::Get().FindConsoleVariable(TEXT("r.Editor.Viewport.ScreenPercentageMode.PathTracer"));
	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"));

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/SCommonEditorViewportToolbarBase.cpp:198

Scope (from outer to inner):

file
function     static FFormatNamedArguments GetScreenPercentageFormatArguments

Source code excerpt:

	static auto CVarEditorViewportDefaultScreenPercentageVRMode = IConsoleManager::Get().FindConsoleVariable(TEXT("r.Editor.Viewport.ScreenPercentageMode.VR"));
	static auto CVarEditorViewportDefaultScreenPercentagePathTracerMode = IConsoleManager::Get().FindConsoleVariable(TEXT("r.Editor.Viewport.ScreenPercentageMode.PathTracer"));
	static auto CVarEditorViewportDefaultScreenPercentageMode = IConsoleManager::Get().FindConsoleVariable(TEXT("r.Editor.Viewport.ScreenPercentageMode.NonRealTime"));

	const UEditorPerformanceProjectSettings* EditorProjectSettings = GetDefault<UEditorPerformanceProjectSettings>();
	const UEditorPerformanceSettings* EditorUserSettings = GetDefault<UEditorPerformanceSettings>();
	const FEngineShowFlags& EngineShowFlags = ViewportClient.EngineShowFlags;

	const EViewStatusForScreenPercentage ViewportRenderingMode = ViewportClient.GetViewStatusForScreenPercentage();

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/SCommonEditorViewportToolbarBase.cpp:249

Scope (from outer to inner):

file
function     static FFormatNamedArguments GetScreenPercentageFormatArguments

Source code excerpt:

		ProjectSetting = EditorProjectSettings->NonRealtimeScreenPercentageMode;
		UserPreference = EditorUserSettings->NonRealtimeScreenPercentageMode;
		CVarDefaultScreenPercentage = CVarEditorViewportDefaultScreenPercentageMode;
	}
	else
	{
		unimplemented();
	}

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

Scope: file

Source code excerpt:



TAutoConsoleVariable<int32> CVarEditorViewportDefaultScreenPercentageMode(
	TEXT("r.Editor.Viewport.ScreenPercentageMode.RealTime"), int32(EScreenPercentageMode::BasedOnDisplayResolution),
	TEXT("Controls the default screen percentage mode for realtime editor viewports using desktop renderer."),
	ECVF_Default);

TAutoConsoleVariable<int32> CVarEditorViewportDefaultMobileScreenPercentageMode(
	TEXT("r.Editor.Viewport.ScreenPercentageMode.Mobile"), int32(EScreenPercentageMode::BasedOnDPIScale),

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

Scope (from outer to inner):

file
function     void UEditorPerformanceProjectSettings::ExportResolutionValuesToConsoleVariables

Source code excerpt:

		const UEditorPerformanceProjectSettings* EditorProjectSettings = GetDefault<UEditorPerformanceProjectSettings>();

		CVarEditorViewportDefaultScreenPercentageMode->Set(int32(EditorProjectSettings->RealtimeScreenPercentageMode), ECVF_SetByProjectSetting);
		CVarEditorViewportDefaultMobileScreenPercentageMode->Set(int32(EditorProjectSettings->MobileScreenPercentageMode), ECVF_SetByProjectSetting);
		CVarEditorViewportDefaultVRScreenPercentageMode->Set(int32(EditorProjectSettings->VRScreenPercentageMode), ECVF_SetByProjectSetting);
		CVarEditorViewportDefaultPathTracerScreenPercentageMode->Set(int32(EditorProjectSettings->PathTracerScreenPercentageMode), ECVF_SetByProjectSetting);
		CVarEditorViewportNonRealtimeDefaultScreenPercentageMode->Set(int32(EditorProjectSettings->NonRealtimeScreenPercentageMode), ECVF_SetByProjectSetting);
		CVarEditorViewportDefaultScreenPercentage->Set(EditorProjectSettings->ManualScreenPercentage, ECVF_SetByProjectSetting);
		CVarEditorViewportDefaultMinRenderingResolution->Set(EditorProjectSettings->MinViewportRenderingResolution, ECVF_SetByProjectSetting);

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

Scope (from outer to inner):

file
function     void UEditorPerformanceProjectSettings::ExportResolutionValuesToConsoleVariables

Source code excerpt:

		};

		OverrideCVarModeWithEditorUserSettings(CVarEditorViewportDefaultScreenPercentageMode, EditorUserSettings->RealtimeScreenPercentageMode);
		OverrideCVarModeWithEditorUserSettings(CVarEditorViewportDefaultMobileScreenPercentageMode, EditorUserSettings->MobileScreenPercentageMode);
		OverrideCVarModeWithEditorUserSettings(CVarEditorViewportDefaultVRScreenPercentageMode, EditorUserSettings->VRScreenPercentageMode);
		OverrideCVarModeWithEditorUserSettings(CVarEditorViewportDefaultPathTracerScreenPercentageMode, EditorUserSettings->PathTracerScreenPercentageMode);
		OverrideCVarModeWithEditorUserSettings(CVarEditorViewportNonRealtimeDefaultScreenPercentageMode, EditorUserSettings->NonRealtimeScreenPercentageMode);

		if (EditorUserSettings->bOverrideManualScreenPercentage)

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

Scope: file

Source code excerpt:

	static auto CVarEditorViewportDefaultScreenPercentageVRMode = IConsoleManager::Get().FindConsoleVariable(TEXT("r.Editor.Viewport.ScreenPercentageMode.VR"));
	static auto CVarEditorViewportDefaultScreenPercentagePathTracerMode = IConsoleManager::Get().FindConsoleVariable(TEXT("r.Editor.Viewport.ScreenPercentageMode.PathTracer"));
	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)
	{

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

Scope: file

Source code excerpt:

	else if (ViewStatus == EViewStatusForScreenPercentage::NonRealtime)
	{
		Mode = EScreenPercentageMode(FMath::Clamp(CVarEditorViewportDefaultScreenPercentageMode->GetInt(), 0, 2));
	}
	else
	{
		unimplemented();
	}
	GlobalResolutionFraction = GetResolutionFraction(CVarEditorViewportDefaultScreenPercentage->GetInt());