r.SceneRenderTargetResizeMethodForceOverride

r.SceneRenderTargetResizeMethodForceOverride

#Overview

name: r.SceneRenderTargetResizeMethodForceOverride

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.SceneRenderTargetResizeMethodForceOverride is to force the ‘r.SceneRenderTargetResizeMethod’ setting to be respected across all configurations in the Unreal Engine rendering system.

This setting variable is primarily used in the rendering subsystem of Unreal Engine 5. It is referenced in the Renderer module and the nDisplay plugin, which suggests it has implications for both standard rendering and multi-display setups.

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 (disabled).

The associated variable CVarSceneTargetsResizeMethodForceOverride interacts directly with r.SceneRenderTargetResizeMethodForceOverride. They share the same value and purpose.

Developers must be aware that enabling this variable (setting it to 1) will override the default behavior of r.SceneRenderTargetResizeMethod on all configurations. This could have performance implications and affect how the engine handles render target resizing across different platforms or scenarios.

Best practices when using this variable include:

  1. Only enable it when you need consistent render target resize behavior across all configurations.
  2. Be cautious when enabling it in VR or other specialized rendering scenarios, as it may interfere with optimizations for those cases.
  3. Test thoroughly on all target platforms after changing this setting, as it may affect performance or visual quality.

Regarding the associated variable CVarSceneTargetsResizeMethodForceOverride:

The purpose of CVarSceneTargetsResizeMethodForceOverride is identical to r.SceneRenderTargetResizeMethodForceOverride. It’s the internal representation of the console variable in the C++ code.

This variable is used within the FSceneTextureExtentState class in the Renderer module to determine whether to use the resize method specified by the r.SceneRenderTargetResizeMethod variable.

The value of this variable is set when the r.SceneRenderTargetResizeMethodForceOverride console command is used.

Developers should be aware that this variable is checked on the render thread, which means changes to it will be applied on the next frame render.

Best practices for using CVarSceneTargetsResizeMethodForceOverride are the same as for r.SceneRenderTargetResizeMethodForceOverride, as they are essentially the same variable exposed in different ways.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SceneTextures.cpp:34

Scope: file

Source code excerpt:


static TAutoConsoleVariable<int32> CVarSceneTargetsResizeMethodForceOverride(
	TEXT("r.SceneRenderTargetResizeMethodForceOverride"),
	0,
	TEXT("Forces 'r.SceneRenderTargetResizeMethod' to be respected on all configurations.\n")
	TEXT("0: Disabled.\n")
	TEXT("1: Enabled.\n"),
	ECVF_RenderThreadSafe
	);

#Loc: <Workspace>/Engine/Plugins/Runtime/nDisplay/Source/DisplayCluster/Private/Game/EngineClasses/Basics/DisplayClusterViewportClient.cpp:358

Scope (from outer to inner):

file
function     void UDisplayClusterViewportClient::Init

Source code excerpt:

		}

		// r.SceneRenderTargetResizeMethodForceOverride
		IConsoleVariable* const RTResizeForceOverrideCVar = IConsoleManager::Get().FindConsoleVariable(TEXT("r.SceneRenderTargetResizeMethodForceOverride"));
		if (RTResizeForceOverrideCVar)
		{
			RTResizeForceOverrideCVar->Set(int32(1));
		}

		// r.SceneRenderTargetResizeMethod

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SceneTextures.cpp:33

Scope: file

Source code excerpt:

	);

static TAutoConsoleVariable<int32> CVarSceneTargetsResizeMethodForceOverride(
	TEXT("r.SceneRenderTargetResizeMethodForceOverride"),
	0,
	TEXT("Forces 'r.SceneRenderTargetResizeMethod' to be respected on all configurations.\n")
	TEXT("0: Disabled.\n")
	TEXT("1: Enabled.\n"),
	ECVF_RenderThreadSafe

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SceneTextures.cpp:176

Scope (from outer to inner):

file
class        class FSceneTextureExtentState
function     FIntPoint Compute

Source code excerpt:

			bool bUseResizeMethodCVar = true;

			if (CVarSceneTargetsResizeMethodForceOverride.GetValueOnRenderThread() != 1)
			{
				if (!FPlatformProperties::SupportsWindowedMode() || bIsVRScene)
				{
					if (bIsVRScene)
					{
						if (!bIsSceneCapture && !bIsReflectionCapture)