r.Editor.Viewport.ScreenPercentageMode.NonRealTime
r.Editor.Viewport.ScreenPercentageMode.NonRealTime
#Overview
name: r.Editor.Viewport.ScreenPercentageMode.NonRealTime
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Controls the default screen percentage mode for non-realtime editor viewports.
It is referenced in 6
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Editor.Viewport.ScreenPercentageMode.NonRealTime is to control the default screen percentage mode for non-realtime editor viewports in Unreal Engine 5.
This setting variable is primarily used by the rendering system, specifically for managing screen percentage in editor viewports. It is part of the UnrealEd module and interacts with the engine’s rendering pipeline.
The value of this variable is set in multiple places:
- It is initially set when the TAutoConsoleVariable is created in EditorProjectSettings.cpp.
- It can be modified through project settings via the UEditorPerformanceProjectSettings class.
- It can be overridden by user settings through the UEditorPerformanceSettings class.
The variable interacts with several other related variables, including:
- r.Editor.Viewport.ScreenPercentageMode.VR
- r.Editor.Viewport.ScreenPercentageMode.PathTracer
- r.Editor.Viewport.ScreenPercentage
- r.Editor.Viewport.MinRenderingResolution
- r.Editor.Viewport.MaxRenderingResolution
Developers should be aware that this variable specifically affects non-realtime editor viewports. It’s part of a larger system for managing screen percentages across different viewport types (VR, PathTracer, Non-realtime).
Best practices when using this variable include:
- Consider the impact on performance and visual quality when adjusting this setting.
- Be aware of the hierarchy of settings (default, project settings, user settings) and how they can override each other.
- Use in conjunction with other related screen percentage variables for a consistent viewport experience.
Regarding the associated variable CVarEditorViewportNonRealtimeDefaultScreenPercentageMode:
This is the actual console variable that stores the value for the screen percentage mode. It’s initialized with the same value and description as r.Editor.Viewport.ScreenPercentageMode.NonRealTime.
The purpose of this variable is the same as r.Editor.Viewport.ScreenPercentageMode.NonRealTime - to control the default screen percentage mode for non-realtime editor viewports.
It’s used in the UEditorPerformanceProjectSettings class to export and override values based on project and user settings. This variable allows for programmatic access and modification of the screen percentage mode setting within the engine’s C++ code.
When working with this variable, developers should:
- Use it for reading or modifying the screen percentage mode programmatically.
- Be aware that changes to this variable will affect all non-realtime editor viewports.
- Consider the performance implications of changing this value, especially in projects with complex scenes or on less powerful hardware.
#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:31
Scope: file
Source code excerpt:
TAutoConsoleVariable<int32> CVarEditorViewportNonRealtimeDefaultScreenPercentageMode(
TEXT("r.Editor.Viewport.ScreenPercentageMode.NonRealTime"), int32(EScreenPercentageMode::BasedOnDPIScale),
TEXT("Controls the default screen percentage mode for non-realtime editor viewports."),
ECVF_Default);
TAutoConsoleVariable<float> CVarEditorViewportDefaultScreenPercentage(
TEXT("r.Editor.Viewport.ScreenPercentage"), 100,
TEXT("Controls the editor viewports' default screen percentage when using r.Editor.Viewport.ScreenPercentageMode=0."),
#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/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)
{
#Associated Variable and Callsites
This variable is associated with another variable named CVarEditorViewportNonRealtimeDefaultScreenPercentageMode
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Settings/EditorProjectSettings.cpp:30
Scope: file
Source code excerpt:
ECVF_Default);
TAutoConsoleVariable<int32> CVarEditorViewportNonRealtimeDefaultScreenPercentageMode(
TEXT("r.Editor.Viewport.ScreenPercentageMode.NonRealTime"), int32(EScreenPercentageMode::BasedOnDPIScale),
TEXT("Controls the default screen percentage mode for non-realtime editor viewports."),
ECVF_Default);
TAutoConsoleVariable<float> CVarEditorViewportDefaultScreenPercentage(
TEXT("r.Editor.Viewport.ScreenPercentage"), 100,
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Settings/EditorProjectSettings.cpp:294
Scope (from outer to inner):
file
function void UEditorPerformanceProjectSettings::ExportResolutionValuesToConsoleVariables
Source code excerpt:
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);
CVarEditorViewportDefaultMaxRenderingResolution->Set(EditorProjectSettings->MaxViewportRenderingResolution, ECVF_SetByProjectSetting);
}
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Settings/EditorProjectSettings.cpp:326
Scope (from outer to inner):
file
function void UEditorPerformanceProjectSettings::ExportResolutionValuesToConsoleVariables
Source code excerpt:
OverrideCVarModeWithEditorUserSettings(CVarEditorViewportDefaultVRScreenPercentageMode, EditorUserSettings->VRScreenPercentageMode);
OverrideCVarModeWithEditorUserSettings(CVarEditorViewportDefaultPathTracerScreenPercentageMode, EditorUserSettings->PathTracerScreenPercentageMode);
OverrideCVarModeWithEditorUserSettings(CVarEditorViewportNonRealtimeDefaultScreenPercentageMode, EditorUserSettings->NonRealtimeScreenPercentageMode);
if (EditorUserSettings->bOverrideManualScreenPercentage)
{
CVarEditorViewportDefaultScreenPercentage->Set(EditorUserSettings->ManualScreenPercentage, ECVF_SetByProjectSetting);
}