Slate.TargetFrameRateForResponsiveness
Slate.TargetFrameRateForResponsiveness
#Overview
name: Slate.TargetFrameRateForResponsiveness
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Minimum sustained average frame rate required before we consider the editor to be \
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of Slate.TargetFrameRateForResponsiveness is to define the minimum sustained average frame rate required for the Unreal Engine editor to be considered “responsive” and provide a smooth UI experience.
-
This setting variable is primarily used by the Slate subsystem, which is responsible for Unreal Engine’s user interface framework.
-
The value of this variable is set as a console variable with a default value of 35 frames per second. It can be modified at runtime through console commands or programmatically.
-
The variable interacts with the AverageDeltaTimeForResponsiveness variable in the FSlateApplication class. It’s used in the IsRunningAtTargetFrameRate() function to determine if the application is running at the target frame rate.
-
Developers should be aware that this variable affects the perceived responsiveness of the editor UI. Setting it too high might lead to false negatives in responsiveness checks, while setting it too low might result in a less smooth UI experience.
-
Best practices when using this variable include:
- Keeping it at a reasonable value (the default of 35 FPS is generally good).
- Adjusting it based on the target hardware capabilities and project requirements.
- Monitoring its impact on UI responsiveness and overall editor performance.
Regarding the associated variable TargetFrameRateForResponsiveness:
-
This is the actual TAutoConsoleVariable instance that represents the Slate.TargetFrameRateForResponsiveness setting.
-
It’s defined in the Slate subsystem and is used directly in the FSlateApplication class.
-
The value is retrieved using the GetValueOnGameThread() method, which ensures thread-safe access to the variable’s value.
-
Developers should use this variable when they need to programmatically access or modify the target frame rate for responsiveness within C++ code.
-
Best practices for using this variable include:
- Accessing it through the provided methods (e.g., GetValueOnGameThread()) to ensure thread safety.
- Considering the impact on performance when frequently accessing or modifying this value.
- Using it in conjunction with other Slate performance metrics for a comprehensive view of UI responsiveness.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Slate/Private/Framework/Application/SlateApplication.cpp:550
Scope: file
Source code excerpt:
/** Minimum sustained average frame rate required before we consider the editor to be "responsive" for a smooth UI experience */
TAutoConsoleVariable<int32> TargetFrameRateForResponsiveness(
TEXT( "Slate.TargetFrameRateForResponsiveness" ),
35, // Frames per second
TEXT( "Minimum sustained average frame rate required before we consider the editor to be \"responsive\" for a smooth UI experience" ) );
/** Whether Slate should go to sleep when there are no active timers and the user is idle */
TAutoConsoleVariable<int32> AllowSlateToSleep(
TEXT("Slate.AllowSlateToSleep"),
#Associated Variable and Callsites
This variable is associated with another variable named TargetFrameRateForResponsiveness
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Slate/Private/Framework/Application/SlateApplication.cpp:549
Scope: file
Source code excerpt:
/** Minimum sustained average frame rate required before we consider the editor to be "responsive" for a smooth UI experience */
TAutoConsoleVariable<int32> TargetFrameRateForResponsiveness(
TEXT( "Slate.TargetFrameRateForResponsiveness" ),
35, // Frames per second
TEXT( "Minimum sustained average frame rate required before we consider the editor to be \"responsive\" for a smooth UI experience" ) );
/** Whether Slate should go to sleep when there are no active timers and the user is idle */
TAutoConsoleVariable<int32> AllowSlateToSleep(
#Loc: <Workspace>/Engine/Source/Runtime/Slate/Private/Framework/Application/SlateApplication.cpp:4007
Scope (from outer to inner):
file
function bool FSlateApplication::IsRunningAtTargetFrameRate
Source code excerpt:
bool FSlateApplication::IsRunningAtTargetFrameRate() const
{
const float MinimumDeltaTime = 1.0f / TargetFrameRateForResponsiveness.GetValueOnGameThread();
return ( AverageDeltaTimeForResponsiveness <= MinimumDeltaTime ) || !IsNormalExecution();
}
bool FSlateApplication::AreMenuAnimationsEnabled() const
{