r.RenderTimeFrozen
r.RenderTimeFrozen
#Overview
name: r.RenderTimeFrozen
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Allows to freeze time based effects in order to provide more deterministic render profiling.\n 0: off\n 1: on (Note: this also disables occlusion queries)
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.RenderTimeFrozen
is to freeze time-based effects in the rendering system, allowing for more deterministic render profiling.
This setting variable is primarily used in the rendering system of Unreal Engine. Based on the callsites, it’s part of the Engine module, specifically within the SceneView component.
The value of this variable is set through a console variable (CVar) system. It’s defined as a TAutoConsoleVariable with an initial value of 0, meaning it’s off by default.
The associated variable CVarRenderTimeFrozen
directly interacts with r.RenderTimeFrozen
. They share the same value and purpose.
Developers must be aware that:
- This is a cheat variable (ECVF_Cheat flag), meaning it’s intended for development and debugging, not for use in shipping builds.
- When enabled (set to 1), it not only freezes time-based effects but also disables occlusion queries.
- It’s only active in non-shipping and non-test builds.
Best practices when using this variable:
- Use it primarily for render profiling and debugging purposes.
- Be cautious when enabling it, as it affects both time-based effects and occlusion queries.
- Remember to disable it after profiling to return to normal rendering behavior.
- Don’t rely on it for gameplay or visual effects in the final product.
Regarding the associated variable CVarRenderTimeFrozen
:
- It’s the C++ representation of the console variable
r.RenderTimeFrozen
. - It’s used to retrieve the current value of the setting (e.g.,
CVarRenderTimeFrozen.GetValueOnAnyThread()
). - When its value is non-zero, it modifies the Time variable in the FSceneViewFamily constructor, effectively freezing the render time.
- Developers should use this variable when they need to programmatically check or modify the frozen render time state within C++ code.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/SceneView.cpp:83
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarRenderTimeFrozen(
TEXT("r.RenderTimeFrozen"),
0,
TEXT("Allows to freeze time based effects in order to provide more deterministic render profiling.\n")
TEXT(" 0: off\n")
TEXT(" 1: on (Note: this also disables occlusion queries)"),
ECVF_Cheat);
#Associated Variable and Callsites
This variable is associated with another variable named CVarRenderTimeFrozen
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/SceneView.cpp:82
Scope: file
Source code excerpt:
ECVF_Cheat);
static TAutoConsoleVariable<int32> CVarRenderTimeFrozen(
TEXT("r.RenderTimeFrozen"),
0,
TEXT("Allows to freeze time based effects in order to provide more deterministic render profiling.\n")
TEXT(" 0: off\n")
TEXT(" 1: on (Note: this also disables occlusion queries)"),
ECVF_Cheat);
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/SceneView.cpp:2920
Scope (from outer to inner):
file
function FSceneViewFamily::FSceneViewFamily
Source code excerpt:
#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
int32 Value = CVarRenderTimeFrozen.GetValueOnAnyThread();
if(Value)
{
Time = FGameTime::CreateDilated(0.0, Time.GetDeltaRealTimeSeconds(), 0.0, Time.GetDeltaWorldTimeSeconds());
}
#endif