r.Test.DynamicResolutionHell
r.Test.DynamicResolutionHell
#Overview
name: r.Test.DynamicResolutionHell
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Override the screen percentage interface for all view family with dynamic resolution hell.\n 0: off (default);\n 1: Dynamic resolution hell.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Test.DynamicResolutionHell is to override the screen percentage interface for all view families with a dynamic resolution “hell” testing mode. This variable is primarily used for testing and debugging purposes in the rendering system of Unreal Engine 5.
This setting variable is used in the Renderer module of Unreal Engine 5, specifically within the scene rendering subsystem. It’s defined in the SceneRendering.cpp file, which is a core part of the engine’s rendering pipeline.
The value of this variable is set through a console variable (CVar) named CVarTestScreenPercentageInterface. It’s initialized with a default value of 0, which means it’s off by default.
The associated variable CVarTestScreenPercentageInterface interacts directly with r.Test.DynamicResolutionHell. They share the same value and purpose.
Developers must be aware that:
- This is a testing feature and should not be used in production builds.
- It only takes effect when the value is set to 1 and the view family has a valid state.
- When enabled, it replaces the normal screen percentage interface with a “dynamic resolution hell” driver.
Best practices when using this variable:
- Use it only for testing and debugging purposes.
- Ensure it’s disabled (set to 0) in production builds.
- Be prepared for potentially extreme or unpredictable behavior in the rendering when enabled, as the name “hell” suggests.
Regarding the associated variable CVarTestScreenPercentageInterface:
- It serves the same purpose as r.Test.DynamicResolutionHell.
- It’s defined as a TAutoConsoleVariable, which allows it to be changed at runtime through console commands.
- It’s used in the FSceneRenderer constructor to potentially override the screen percentage interface.
- When set to 1, it creates a new FScreenPercentageHellDriver for the view family, replacing the original screen percentage interface.
Developers should treat CVarTestScreenPercentageInterface with the same caution as r.Test.DynamicResolutionHell, using it only for testing and ensuring it’s not enabled in production environments.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SceneRendering.cpp:396
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarTestScreenPercentageInterface(
TEXT("r.Test.DynamicResolutionHell"),
0,
TEXT("Override the screen percentage interface for all view family with dynamic resolution hell.\n")
TEXT(" 0: off (default);\n")
TEXT(" 1: Dynamic resolution hell."),
ECVF_Default);
#Associated Variable and Callsites
This variable is associated with another variable named CVarTestScreenPercentageInterface
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SceneRendering.cpp:395
Scope: file
Source code excerpt:
TEXT(" 0: disabled (default); 1: enabled."));
static TAutoConsoleVariable<int32> CVarTestScreenPercentageInterface(
TEXT("r.Test.DynamicResolutionHell"),
0,
TEXT("Override the screen percentage interface for all view family with dynamic resolution hell.\n")
TEXT(" 0: off (default);\n")
TEXT(" 1: Dynamic resolution hell."),
ECVF_Default);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SceneRendering.cpp:2780
Scope (from outer to inner):
file
function FSceneRenderer::FSceneRenderer
Source code excerpt:
#if !UE_BUILD_SHIPPING
// Override screen percentage interface.
if (int32 OverrideId = CVarTestScreenPercentageInterface.GetValueOnGameThread())
{
check(ViewFamily.ScreenPercentageInterface);
// Replaces screen percentage interface with dynamic resolution hell's driver.
if (OverrideId == 1 && ViewFamily.Views[0]->State)
{