r.DynamicRes.IncreaseAmortizationBlendFactor

r.DynamicRes.IncreaseAmortizationBlendFactor

#Overview

name: r.DynamicRes.IncreaseAmortizationBlendFactor

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

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of r.DynamicRes.IncreaseAmortizationBlendFactor is to control the amortization blend factor when scaling the resolution back up in the dynamic resolution system. This setting is part of Unreal Engine’s dynamic resolution feature, which adjusts the rendering resolution in real-time to maintain performance targets.

This setting variable is primarily used in the dynamic resolution subsystem of Unreal Engine’s rendering module. Based on the callsites, it’s implemented in the Engine module, specifically in the DynamicResolution.cpp file.

The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value from DynamicRenderScaling::FHeuristicSettings::kDefaultIncreaseAmortizationFactor, but can be changed at runtime through console commands or configuration files.

This variable interacts closely with other dynamic resolution settings, such as r.DynamicRes.ChangePercentageThreshold (CVarChangeThreshold in the code). It’s part of a group of settings that collectively control the behavior of the dynamic resolution system.

Developers should be aware that this variable affects how quickly the resolution increases when the system determines it’s safe to do so. A higher value will result in faster resolution increases, while a lower value will cause more gradual changes. This can impact both performance and visual quality, so it should be tuned carefully.

Best practices when using this variable include:

  1. Testing different values to find the right balance between responsiveness and stability for your specific game.
  2. Considering the target platform and typical performance scenarios when setting this value.
  3. Using it in conjunction with other dynamic resolution settings for optimal results.
  4. Monitoring its effects during gameplay to ensure it’s not causing noticeable visual artifacts or performance issues.

Regarding the associated variable CVarIncreaseAmortizationFactor:

This is the actual C++ variable that holds the value of the r.DynamicRes.IncreaseAmortizationBlendFactor console variable. It’s defined as a TAutoConsoleVariable, which is Unreal Engine’s way of creating a console variable that can be easily accessed and modified.

The value of CVarIncreaseAmortizationFactor is used in the GetPrimaryDynamicResolutionSettings function to populate the IncreaseAmortizationFactor field of the FHeuristicSettings struct. This struct is likely used by the dynamic resolution system to determine how to adjust the resolution.

When working with CVarIncreaseAmortizationFactor, developers should:

  1. Use the GetValueOnAnyThread() method to safely access its value from any thread.
  2. Be aware that changes to this variable will affect the behavior of the dynamic resolution system in real-time.
  3. Consider exposing this setting in user-facing graphics options if fine-tuning by end-users is desired.
  4. Use appropriate thread-safety measures when modifying this value, as it’s marked with ECVF_RenderThreadSafe.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/DynamicResolution.cpp:110

Scope: file

Source code excerpt:


static TAutoConsoleVariable<float> CVarIncreaseAmortizationFactor(
	TEXT("r.DynamicRes.IncreaseAmortizationBlendFactor"),
	DynamicRenderScaling::FHeuristicSettings::kDefaultIncreaseAmortizationFactor,
	TEXT("Amortization blend factor when scale resolution back up to reduce resolution fraction oscillations."),
	ECVF_RenderThreadSafe | ECVF_Default);

static TAutoConsoleVariable<float> CVarChangeThreshold(
	TEXT("r.DynamicRes.ChangePercentageThreshold"),

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/DynamicResolution.cpp:109

Scope: file

Source code excerpt:

	ECVF_RenderThreadSafe | ECVF_Default);

static TAutoConsoleVariable<float> CVarIncreaseAmortizationFactor(
	TEXT("r.DynamicRes.IncreaseAmortizationBlendFactor"),
	DynamicRenderScaling::FHeuristicSettings::kDefaultIncreaseAmortizationFactor,
	TEXT("Amortization blend factor when scale resolution back up to reduce resolution fraction oscillations."),
	ECVF_RenderThreadSafe | ECVF_Default);

static TAutoConsoleVariable<float> CVarChangeThreshold(

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/DynamicResolution.cpp:155

Scope (from outer to inner):

file
function     DynamicRenderScaling::FHeuristicSettings GetPrimaryDynamicResolutionSettings

Source code excerpt:

	BudgetSetting.ChangeThreshold            = DynamicRenderScaling::GetPercentageCVarToFraction(CVarChangeThreshold);
	BudgetSetting.TargetedHeadRoom           = DynamicRenderScaling::GetPercentageCVarToFraction(CVarTargetedGPUHeadRoomPercentage);
	BudgetSetting.IncreaseAmortizationFactor = CVarIncreaseAmortizationFactor.GetValueOnAnyThread();
	return BudgetSetting;
}

DynamicRenderScaling::FBudget GDynamicPrimaryResolutionFraction(TEXT("DynamicPrimaryResolution"), &GetPrimaryDynamicResolutionSettings);