r.CameraShakeDebug.LargeGraph

r.CameraShakeDebug.LargeGraph

#Overview

name: r.CameraShakeDebug.LargeGraph

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.CameraShakeDebug.LargeGraph is to control the size of debug graphs for camera shake information in Unreal Engine 5. It is specifically used for debugging and visualization purposes within the camera system.

This setting variable is primarily used in the Engine module, specifically in the camera shake debugging functionality. It is referenced in the CameraModifier_CameraShake.cpp file, which is part of the camera system in Unreal Engine.

The value of this variable is set through a console variable (CVar) named GCameraShakeDebugLargeGraphCVar. It is initialized with a default value of false, meaning that by default, larger graphs are not drawn for camera shake debug info.

The associated variable GCameraShakeDebugLargeGraphCVar directly interacts with r.CameraShakeDebug.LargeGraph. They share the same value and purpose.

Developers must be aware that this variable is intended for debugging purposes only. It should not be relied upon for gameplay or production-level features. The variable affects the visual representation of debug information and does not impact the actual camera shake behavior.

Best practices when using this variable include:

  1. Only enable it when actively debugging camera shake issues.
  2. Be mindful of performance implications when enabling larger graphs, especially on lower-end hardware.
  3. Use it in conjunction with other camera shake debug variables for a comprehensive debugging experience.
  4. Remember to disable it when not needed to avoid unnecessary overhead.

Regarding the associated variable GCameraShakeDebugLargeGraphCVar:

The purpose of GCameraShakeDebugLargeGraphCVar is to provide programmatic access to the r.CameraShakeDebug.LargeGraph setting within the C++ code.

This variable is used in the Engine module, specifically in the camera shake debugging system. It’s defined and used in the CameraModifier_CameraShake.cpp file.

The value of GCameraShakeDebugLargeGraphCVar is set when the r.CameraShakeDebug.LargeGraph console variable is modified. It can be accessed in the code using the GetValueOnGameThread() method.

GCameraShakeDebugLargeGraphCVar directly interacts with the r.CameraShakeDebug.LargeGraph console variable, serving as its C++ representation.

Developers should be aware that this variable is used internally by the engine to determine whether to draw larger debug graphs. It should not be modified directly but rather through the r.CameraShakeDebug.LargeGraph console variable.

Best practices for using GCameraShakeDebugLargeGraphCVar include:

  1. Use GetValueOnGameThread() to read its current value in C++ code.
  2. Avoid setting its value directly; instead, use the console variable r.CameraShakeDebug.LargeGraph.
  3. Consider the performance impact when frequently checking this value in performance-critical code sections.

#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:34

Scope: file

Source code excerpt:

	TEXT("Whether to show camera shakes' rotation modifications (defaults to true)"));
TAutoConsoleVariable<bool> GCameraShakeDebugLargeGraphCVar(
	TEXT("r.CameraShakeDebug.LargeGraph"),
	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)"));

#Associated Variable and Callsites

This variable is associated with another variable named GCameraShakeDebugLargeGraphCVar. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Camera/CameraModifier_CameraShake.cpp:33

Scope: file

Source code excerpt:

	true,
	TEXT("Whether to show camera shakes' rotation modifications (defaults to true)"));
TAutoConsoleVariable<bool> GCameraShakeDebugLargeGraphCVar(
	TEXT("r.CameraShakeDebug.LargeGraph"),
	false,
	TEXT("Draws larger graphs for camera shake debug info"));
TAutoConsoleVariable<float> GCameraShakeDebugInfoRecordLimitCVar(
	TEXT("r.CameraShakeDebug.InfoRecordLimit"),
	2,

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Camera/CameraModifier_CameraShake.cpp:598

Scope (from outer to inner):

file
function     void UCameraModifier_CameraShake::DisplayDebugGraphs

Source code excerpt:

	const float FontHeight = DrawFont->GetMaxCharHeight();
	
	const bool bDrawLargeGraphs = GCameraShakeDebugLargeGraphCVar.GetValueOnGameThread();

	const float GraphWidth = bDrawLargeGraphs ? 320.f : 160.f;
	const float GraphHeight = bDrawLargeGraphs ? 120.f : 60.0f;
	const float GraphRightXPos = Canvas->SizeX - 20;
	const float GraphLeftXPos = GraphRightXPos - GraphWidth;