r.CameraShakeDebug.InfoRecordLimit
r.CameraShakeDebug.InfoRecordLimit
#Overview
name: r.CameraShakeDebug.InfoRecordLimit
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
How many seconds to keep while recording camera shake debug info (defaults to 2 seconds)
It is referenced in 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.CameraShakeDebug.InfoRecordLimit is to control the duration of recorded camera shake debug information in Unreal Engine 5. It sets the number of seconds of debug data to keep for camera shake debugging purposes.
-
This setting variable is primarily used by the camera system, specifically for debugging camera shake effects.
-
The Unreal Engine subsystem that relies on this setting variable is the camera modification system, particularly the CameraModifier_CameraShake module.
-
The value of this variable is set through a console variable (CVar) named GCameraShakeDebugInfoRecordLimitCVar. It’s initialized with a default value of 2 seconds.
-
This variable interacts with the debug drawing system in Unreal Engine. It’s used to determine the time range for which camera shake debug information is recorded and displayed.
-
Developers should be aware that this variable only affects debug information and has no impact on the actual camera shake behavior in the game. It’s purely for development and debugging purposes.
-
Best practices for using this variable include:
- Adjusting the value based on the complexity and duration of camera shakes being debugged.
- Using it in conjunction with other camera shake debug tools and visualizations.
- Remembering to reset it to a reasonable value (like the default 2 seconds) after debugging to avoid unnecessary memory usage.
Regarding the associated variable GCameraShakeDebugInfoRecordLimitCVar:
The purpose of GCameraShakeDebugInfoRecordLimitCVar is to provide a runtime-accessible way to modify the r.CameraShakeDebug.InfoRecordLimit value.
-
It’s used in the same camera modification system as r.CameraShakeDebug.InfoRecordLimit.
-
The value of this variable is set when the engine initializes the console variables, but it can be changed at runtime through console commands.
-
This variable is directly accessed in the code to retrieve the current debug info record limit.
-
Developers should be aware that changes to this variable will take effect immediately in the running game, allowing for real-time adjustments to the debug information display.
-
Best practices for using this variable include:
- Using it for quick iterations during debugging sessions.
- Remembering that it affects all camera shake debug displays, not just a specific instance.
- Considering performance implications when setting very large values, as it may impact memory usage for debug data storage.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Camera/CameraModifier_CameraShake.cpp:38
Scope: file
Source code excerpt:
TEXT("Draws larger graphs for camera shake debug info"));
TAutoConsoleVariable<float> GCameraShakeDebugInfoRecordLimitCVar(
TEXT("r.CameraShakeDebug.InfoRecordLimit"),
2,
TEXT("How many seconds to keep while recording camera shake debug info (defaults to 2 seconds)"));
UCameraModifier_CameraShake::UCameraModifier_CameraShake(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
#if UE_ENABLE_DEBUG_DRAWING
#Associated Variable and Callsites
This variable is associated with another variable named GCameraShakeDebugInfoRecordLimitCVar
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Camera/CameraModifier_CameraShake.cpp:37
Scope: file
Source code excerpt:
false,
TEXT("Draws larger graphs for camera shake debug info"));
TAutoConsoleVariable<float> GCameraShakeDebugInfoRecordLimitCVar(
TEXT("r.CameraShakeDebug.InfoRecordLimit"),
2,
TEXT("How many seconds to keep while recording camera shake debug info (defaults to 2 seconds)"));
UCameraModifier_CameraShake::UCameraModifier_CameraShake(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Camera/CameraModifier_CameraShake.cpp:75
Scope (from outer to inner):
file
function bool UCameraModifier_CameraShake::ModifyCamera
Source code excerpt:
#if UE_ENABLE_DEBUG_DRAWING
const float DebugDataLimit = GCameraShakeDebugInfoRecordLimitCVar.GetValueOnGameThread();
#endif
// Update and apply active shakes
if( ActiveShakes.Num() > 0 )
{
for (FActiveCameraShakeInfo& ShakeInfo : ActiveShakes)
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Camera/CameraModifier_CameraShake.cpp:605
Scope (from outer to inner):
file
function void UCameraModifier_CameraShake::DisplayDebugGraphs
Source code excerpt:
const float GraphLeftXPos = GraphRightXPos - GraphWidth;
const float DebugDataLimit = GCameraShakeDebugInfoRecordLimitCVar.GetValueOnGameThread();
const float PixelsPerSecond = GraphWidth / (DebugDataLimit > 0 ? DebugDataLimit : 3.f);
for (int i = 0; i < DebugShakes.Num(); i++)
{
const FCameraShakeDebugData& DebugShake = DebugShakes[i];
if (DebugShake.DataPoints.IsEmpty())