r.RenderTimeFrozen

r.RenderTimeFrozen

#Overview

name: r.RenderTimeFrozen

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.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:

  1. This is a cheat variable (ECVF_Cheat flag), meaning it’s intended for development and debugging, not for use in shipping builds.
  2. When enabled (set to 1), it not only freezes time-based effects but also disables occlusion queries.
  3. It’s only active in non-shipping and non-test builds.

Best practices when using this variable:

  1. Use it primarily for render profiling and debugging purposes.
  2. Be cautious when enabling it, as it affects both time-based effects and occlusion queries.
  3. Remember to disable it after profiling to return to normal rendering behavior.
  4. Don’t rely on it for gameplay or visual effects in the final product.

Regarding the associated variable CVarRenderTimeFrozen:

#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