au.Debug.Display.X
au.Debug.Display.X
#Overview
name: au.Debug.Display.X
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
X position on screen of debug statistics. \nDefault: 100
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of au.Debug.Display.X is to control the X-coordinate position on the screen where audio debug statistics are displayed. This setting variable is part of the audio debugging system in Unreal Engine 5.
This setting variable is primarily used in the Engine module, specifically within the audio debugging subsystem. It’s referenced in the AudioDebug.cpp file, which is responsible for rendering audio-related debug information on the screen.
The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of 100, but can be changed at runtime through console commands or programmatically.
The au.Debug.Display.X variable interacts directly with a static integer variable named SoundDebugDisplayCornerXCVar. They share the same value, with SoundDebugDisplayCornerXCVar serving as the actual storage for the X-coordinate value.
Developers should be aware that this variable affects the horizontal positioning of all audio debug statistics on the screen. Changing its value will shift the entire debug display left or right.
Best practices when using this variable include:
- Adjusting it in conjunction with au.Debug.Display.Y for optimal positioning of debug information.
- Using it primarily for development and debugging purposes, not in production builds.
- Being mindful of screen resolution and UI scaling when setting values.
Regarding the associated variable SoundDebugDisplayCornerXCVar:
The purpose of SoundDebugDisplayCornerXCVar is to store the actual X-coordinate value used for positioning audio debug statistics on the screen. It’s the backend storage for the au.Debug.Display.X console variable.
This variable is used within the Engine module, specifically in the FAudioDebugger class’s DrawDebugStatsInternal function, where it determines the horizontal starting position for rendering various audio debug statistics.
The value of SoundDebugDisplayCornerXCVar is set indirectly through the au.Debug.Display.X console variable. Any changes to au.Debug.Display.X will be reflected in SoundDebugDisplayCornerXCVar.
SoundDebugDisplayCornerXCVar interacts with a similar Y-coordinate variable (SoundDebugDisplayCornerYCVar) to determine the overall position of the debug display.
Developers should be aware that this variable is used directly in the rendering code, so its value directly affects the position of debug output.
Best practices for SoundDebugDisplayCornerXCVar include:
- Not modifying it directly, but instead using the au.Debug.Display.X console variable.
- Considering it in conjunction with the Y-coordinate when positioning debug output.
- Using it as a read-only value within rendering code, relying on the console variable system for modifications.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/AudioDebug.cpp:142
Scope: file
Source code excerpt:
static int32 SoundDebugDisplayCornerXCVar = 100;
FAutoConsoleVariableRef CVarSoundDebugDisplayCornerX(
TEXT("au.Debug.Display.X"),
SoundDebugDisplayCornerXCVar,
TEXT("X position on screen of debug statistics. \n")
TEXT("Default: 100"),
ECVF_Default);
static int32 SoundDebugDisplayCornerYCVar = -1;
#Associated Variable and Callsites
This variable is associated with another variable named SoundDebugDisplayCornerXCVar
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/AudioDebug.cpp:140
Scope: file
Source code excerpt:
ECVF_Default);
static int32 SoundDebugDisplayCornerXCVar = 100;
FAutoConsoleVariableRef CVarSoundDebugDisplayCornerX(
TEXT("au.Debug.Display.X"),
SoundDebugDisplayCornerXCVar,
TEXT("X position on screen of debug statistics. \n")
TEXT("Default: 100"),
ECVF_Default);
static int32 SoundDebugDisplayCornerYCVar = -1;
FAutoConsoleVariableRef CVarSoundDebugDisplayCornerY(
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/AudioDebug.cpp:1348
Scope (from outer to inner):
file
namespace Audio
function int32 FAudioDebugger::DrawDebugStatsInternal
Source code excerpt:
}
int32 X = SoundDebugDisplayCornerXCVar;
int32 Y = SoundDebugDisplayCornerYCVar < 0 ? InY : SoundDebugDisplayCornerYCVar;
Y = RenderStatMixes(&World, &Viewport, Canvas, X, Y);
Y = RenderStatModulators(&World, &Viewport, Canvas, X, Y, nullptr, nullptr);
Y = RenderStatReverb(&World, &Viewport, Canvas, X, Y);
Y = RenderStatSounds(&World, &Viewport, Canvas, X, Y);