r.Editor.Viewport.ScreenPercentageMode.PathTracer

r.Editor.Viewport.ScreenPercentageMode.PathTracer

#Overview

name: r.Editor.Viewport.ScreenPercentageMode.PathTracer

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

It is referenced in 6 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of r.Editor.Viewport.ScreenPercentageMode.PathTracer is to control the default screen percentage mode for path-traced viewports in the Unreal Engine editor.

This setting variable is primarily used by the rendering system, specifically for path-traced viewports in the Unreal Editor. It is part of the editor’s performance settings and affects how the screen percentage is calculated for these specific viewports.

Based on the callsites, this variable is used in the UnrealEd module, which is responsible for the Unreal Engine editor functionality. It’s also referenced in the Engine module’s LegacyScreenPercentageDriver, indicating its impact on the rendering pipeline.

The value of this variable is set through the UEditorPerformanceProjectSettings class, which handles editor performance settings. It can be set both through project settings and potentially overridden by user settings.

This variable interacts with several other screen percentage-related variables, such as those for mobile, VR, and non-realtime viewports. It’s part of a group of settings that control viewport rendering quality and performance.

Developers should be aware that this setting specifically affects path-traced viewports, which are typically used for high-quality, offline rendering. Changing this setting could impact the quality and performance of these viewports.

Best practices when using this variable include:

  1. Considering the performance implications of the chosen mode, especially for less powerful hardware.
  2. Balancing quality and performance based on the specific needs of the project.
  3. Being aware of how it interacts with other screen percentage settings.

Regarding the associated variable CVarEditorViewportDefaultPathTracerScreenPercentageMode:

This is the actual console variable that stores the value of the setting. It’s initialized with the default value of EScreenPercentageMode::Manual, suggesting that by default, the screen percentage for path-traced viewports is set manually rather than being automatically calculated.

This variable is used in the ExportResolutionValuesToConsoleVariables function of UEditorPerformanceProjectSettings to apply the settings from the project or user configuration to the actual console variable. This allows for the setting to be changed through the editor interface and then applied to the engine’s rendering system.

Developers should note that changes to this variable will take effect when the editor settings are applied, typically when the editor is started or when settings are explicitly updated. The value of this variable can be overridden by user settings, allowing for personal customization of the editor environment.

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

Scope: file

Source code excerpt:


TAutoConsoleVariable<int32> CVarEditorViewportDefaultPathTracerScreenPercentageMode(
	TEXT("r.Editor.Viewport.ScreenPercentageMode.PathTracer"), int32(EScreenPercentageMode::Manual),
	TEXT("Controls the default screen percentage mode for path-traced viewports."),
	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."),

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

Scope (from outer to inner):

file
function     static FFormatNamedArguments GetScreenPercentageFormatArguments

Source code excerpt:

	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>();
	const UEditorPerformanceSettings* EditorUserSettings = GetDefault<UEditorPerformanceSettings>();
	const FEngineShowFlags& EngineShowFlags = ViewportClient.EngineShowFlags;

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

Scope: file

Source code excerpt:

	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"));
	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 CVarEditorViewportDefaultPathTracerScreenPercentageMode. They share the same value. See the following C++ source code.

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

Scope: file

Source code excerpt:

	ECVF_Default);

TAutoConsoleVariable<int32> CVarEditorViewportDefaultPathTracerScreenPercentageMode(
	TEXT("r.Editor.Viewport.ScreenPercentageMode.PathTracer"), int32(EScreenPercentageMode::Manual),
	TEXT("Controls the default screen percentage mode for path-traced viewports."),
	ECVF_Default);

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

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

Scope (from outer to inner):

file
function     void UEditorPerformanceProjectSettings::ExportResolutionValuesToConsoleVariables

Source code excerpt:

		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);
		CVarEditorViewportDefaultMaxRenderingResolution->Set(EditorProjectSettings->MaxViewportRenderingResolution, ECVF_SetByProjectSetting);
	}

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

Scope (from outer to inner):

file
function     void UEditorPerformanceProjectSettings::ExportResolutionValuesToConsoleVariables

Source code excerpt:

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

		if (EditorUserSettings->bOverrideManualScreenPercentage)
		{
			CVarEditorViewportDefaultScreenPercentage->Set(EditorUserSettings->ManualScreenPercentage, ECVF_SetByProjectSetting);
		}