r.MeshCardRepresentation.Debug
r.MeshCardRepresentation.Debug
#Overview
name: r.MeshCardRepresentation.Debug
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Enable mesh cards debugging. Skips DDCs and appends extra debug data.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.MeshCardRepresentation.Debug is to enable debugging for mesh card representations in Unreal Engine 5. It is primarily used for the rendering system, specifically for debugging mesh cards.
This setting variable is relied upon by the Engine module, particularly the MeshCardRepresentation subsystem. This can be inferred from its location in the Engine/Source/Runtime/Engine/Private/MeshCardRepresentation.cpp file.
The value of this variable is set through the console variable system in Unreal Engine. It is initialized with a default value of 0, which means debugging is disabled by default.
The associated variable CVarCardRepresentationDebug interacts directly with r.MeshCardRepresentation.Debug. They share the same value and purpose.
Developers must be aware of several special considerations when using this variable:
- It is marked with ECVF_Cheat flag, indicating it should only be used for debugging and not in production builds.
- When enabled, it skips DDCs (Derived Data Caches) and appends extra debug data, which can impact performance.
- It’s only effective in Debug or Development builds, not in shipping builds.
Best practices for using this variable include:
- Only enable it when actively debugging mesh card representations.
- Be aware of the performance impact when enabled, especially due to skipping DDCs.
- Use it in conjunction with other mesh card representation debug tools for comprehensive debugging.
- Remember to disable it after debugging to restore normal performance.
Regarding the associated variable CVarCardRepresentationDebug:
The purpose of CVarCardRepresentationDebug is to provide programmatic access to the r.MeshCardRepresentation.Debug setting within the C++ code.
It is used in the Engine module, specifically in the MeshCardRepresentation class.
The value of this variable is set automatically based on the r.MeshCardRepresentation.Debug console variable.
It interacts directly with r.MeshCardRepresentation.Debug, essentially serving as its C++ representation.
Developers should be aware that this variable is used to check the debug state in the IsDebugMode() function of the MeshCardRepresentation class.
Best practices for using this variable include:
- Use it for conditional compilation or execution of debug-only code.
- Remember that it will always return false in shipping builds, so design your debug code accordingly.
- Consider the performance implications of frequently checking this variable in performance-critical code paths.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/MeshCardRepresentation.cpp:61
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarCardRepresentationDebug(
TEXT("r.MeshCardRepresentation.Debug"),
0,
TEXT("Enable mesh cards debugging. Skips DDCs and appends extra debug data."),
ECVF_Cheat);
static TAutoConsoleVariable<int32> CVarCardRepresentationDebugSurfelDirection(
TEXT("r.MeshCardRepresentation.Debug.SurfelDirection"),
#Associated Variable and Callsites
This variable is associated with another variable named CVarCardRepresentationDebug
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/MeshCardRepresentation.cpp:60
Scope: file
Source code excerpt:
ECVF_ReadOnly);
static TAutoConsoleVariable<int32> CVarCardRepresentationDebug(
TEXT("r.MeshCardRepresentation.Debug"),
0,
TEXT("Enable mesh cards debugging. Skips DDCs and appends extra debug data."),
ECVF_Cheat);
static TAutoConsoleVariable<int32> CVarCardRepresentationDebugSurfelDirection(
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/MeshCardRepresentation.cpp:85
Scope (from outer to inner):
file
function bool MeshCardRepresentation::IsDebugMode
Source code excerpt:
{
#if UE_BUILD_DEBUG || UE_BUILD_DEVELOPMENT
return CVarCardRepresentationDebug.GetValueOnAnyThread() != 0;
#else
return false;
#endif
}
int32 MeshCardRepresentation::GetDebugSurfelDirection()