r.CameraShakeDebug
r.CameraShakeDebug
#Overview
name: r.CameraShakeDebug
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Show extra debug info for camera shakes (requires
showdebug CAMERA)
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.CameraShakeDebug is to enable extra debug information for camera shakes in Unreal Engine 5. This setting is primarily used for debugging and visualizing camera shake effects during development.
-
The r.CameraShakeDebug variable is used in the camera system, specifically for debugging camera shake effects.
-
This setting is primarily used in the Engine module, particularly within the camera-related components.
-
The value of this variable is set through a console variable (CVar) system. It’s initialized as false by default but can be changed at runtime through console commands or configuration files.
-
This variable interacts with other debug-related variables, such as GShowCameraShakeDebugLocationCVar and GShowCameraShakeDebugRotationCVar, to control specific aspects of the debug visualization.
-
Developers should be aware that this debug feature requires the ‘showdebug CAMERA’ command to be active to display the extra debug information.
-
Best practices for using this variable include:
- Enable it only when debugging camera shake issues.
- Use it in conjunction with other camera debug tools for a comprehensive view.
- Remember to disable it in release builds to avoid performance overhead.
Regarding the associated variable GShowCameraShakeDebugCVar:
The purpose of GShowCameraShakeDebugCVar is to serve as the actual console variable that controls the r.CameraShakeDebug setting.
-
This variable is used internally by the engine to store and retrieve the current state of the r.CameraShakeDebug setting.
-
It’s defined in the Engine module, specifically in the CameraModifier_CameraShake.cpp file.
-
The value is set through the TAutoConsoleVariable template, which allows it to be changed at runtime via console commands.
-
It interacts directly with r.CameraShakeDebug, essentially serving as its backend storage.
-
Developers should be aware that modifying GShowCameraShakeDebugCVar directly in code will affect the r.CameraShakeDebug setting.
-
Best practices include:
- Use the r.CameraShakeDebug console command to modify this setting rather than changing the variable directly.
- When checking the state in code, use GShowCameraShakeDebugCVar.GetValueOnGameThread() to ensure thread-safe access.
#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:22
Scope: file
Source code excerpt:
TAutoConsoleVariable<bool> GShowCameraShakeDebugCVar(
TEXT("r.CameraShakeDebug"),
false,
TEXT("Show extra debug info for camera shakes (requires `showdebug CAMERA`)"));
TAutoConsoleVariable<bool> GShowCameraShakeDebugLocationCVar(
TEXT("r.CameraShakeDebug.Location"),
true,
TEXT("Whether to show camera shakes' location modifications (defaults to true)"));
#Associated Variable and Callsites
This variable is associated with another variable named GShowCameraShakeDebugCVar
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Camera/CameraModifier_CameraShake.cpp:21
Scope: file
Source code excerpt:
DECLARE_CYCLE_STAT(TEXT("AddCameraShake"), STAT_AddCameraShake, STATGROUP_Game);
TAutoConsoleVariable<bool> GShowCameraShakeDebugCVar(
TEXT("r.CameraShakeDebug"),
false,
TEXT("Show extra debug info for camera shakes (requires `showdebug CAMERA`)"));
TAutoConsoleVariable<bool> GShowCameraShakeDebugLocationCVar(
TEXT("r.CameraShakeDebug.Location"),
true,
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Camera/CameraModifier_CameraShake.cpp:570
Scope (from outer to inner):
file
function void UCameraModifier_CameraShake::DisplayDebugGraphs
Source code excerpt:
// See if we should be recording and display shake data.
const bool bShowLocationDebug = GShowCameraShakeDebugCVar.GetValueOnGameThread() &&
GShowCameraShakeDebugLocationCVar.GetValueOnGameThread();
const bool bShowRotationDebug = GShowCameraShakeDebugCVar.GetValueOnGameThread() &&
GShowCameraShakeDebugRotationCVar.GetValueOnGameThread();
bRecordDebugData = bShowLocationDebug || bShowRotationDebug;
if (!bRecordDebugData)
{
return;