wp.Runtime.HLOD.WarmupDebugDraw

wp.Runtime.HLOD.WarmupDebugDraw

#Overview

name: wp.Runtime.HLOD.WarmupDebugDraw

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 wp.Runtime.HLOD.WarmupDebugDraw is to enable debug drawing for HLOD (Hierarchical Level of Detail) warmup requests in Unreal Engine 5. This setting is primarily used for the HLOD system, which is part of the rendering and performance optimization features of the engine.

This setting variable is utilized by the WorldPartition HLOD Runtime Subsystem, which is part of the Engine module. It’s specifically used in the HLODRuntimeSubsystem.cpp file.

The value of this variable is set through a console variable (CVar) named CVarHLODWarmupDebugDraw. It’s initialized with a default value of 0, meaning the debug drawing is disabled by default.

The associated variable CVarHLODWarmupDebugDraw directly interacts with wp.Runtime.HLOD.WarmupDebugDraw. They share the same value and purpose.

Developers must be aware that this variable is primarily for debugging purposes. When enabled, it will draw debug boxes around HLOD actors during the warmup process. This can be useful for visualizing the HLOD system’s behavior but may impact performance if left enabled in a shipping build.

Best practices when using this variable include:

  1. Only enable it when actively debugging HLOD-related issues.
  2. Disable it in shipping builds to avoid unnecessary performance overhead.
  3. Use it in conjunction with other HLOD-related debug tools and settings for comprehensive debugging.
  4. Be aware that the debug drawing is only visible when ENABLE_DRAW_DEBUG is defined.

Regarding the associated variable CVarHLODWarmupDebugDraw:

The purpose of CVarHLODWarmupDebugDraw is identical to wp.Runtime.HLOD.WarmupDebugDraw. It’s a console variable that controls the debug drawing for HLOD warmup requests.

This variable is used in the WorldPartition HLOD Runtime Subsystem, specifically in the OnBeginRenderViews function of the UWorldPartitionHLODRuntimeSubsystem class.

The value of CVarHLODWarmupDebugDraw is set when the console variable is initialized, and it can be changed at runtime through console commands.

CVarHLODWarmupDebugDraw directly interacts with wp.Runtime.HLOD.WarmupDebugDraw, as they represent the same setting.

Developers should be aware that the debug drawing controlled by this variable is only executed if ENABLE_DRAW_DEBUG is defined. This is typically only the case in development builds.

Best practices for using CVarHLODWarmupDebugDraw are the same as those for wp.Runtime.HLOD.WarmupDebugDraw, focusing on using it as a temporary debugging tool rather than a permanent feature in production code.

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/WorldPartition/HLOD/HLODRuntimeSubsystem.cpp:57

Scope: file

Source code excerpt:


static TAutoConsoleVariable<int32> CVarHLODWarmupDebugDraw(
	TEXT("wp.Runtime.HLOD.WarmupDebugDraw"),
	0,
	TEXT("Draw debug display for the warmup requests"));

static TAutoConsoleVariable<float> CVarHLODWarmupVTScaleFactor(
	TEXT("wp.Runtime.HLOD.WarmupVTScaleFactor"),
	2.0f,

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/WorldPartition/HLOD/HLODRuntimeSubsystem.cpp:56

Scope: file

Source code excerpt:

	TEXT("Delay unloading of a cell for this amount of frames to ensure HLOD assets are ready to be shown at the proper resolution. Set to 0 to force disable warmup."));

static TAutoConsoleVariable<int32> CVarHLODWarmupDebugDraw(
	TEXT("wp.Runtime.HLOD.WarmupDebugDraw"),
	0,
	TEXT("Draw debug display for the warmup requests"));

static TAutoConsoleVariable<float> CVarHLODWarmupVTScaleFactor(
	TEXT("wp.Runtime.HLOD.WarmupVTScaleFactor"),

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/WorldPartition/HLOD/HLODRuntimeSubsystem.cpp:707

Scope (from outer to inner):

file
function     void UWorldPartitionHLODRuntimeSubsystem::OnBeginRenderViews

Source code excerpt:


#if ENABLE_DRAW_DEBUG
				if (CVarHLODWarmupDebugDraw.GetValueOnAnyThread())
				{
					DrawDebugBox(HLODActor->GetWorld(), BoundsOrigin, BoundsExtent, FColor::Yellow, /*bPersistentLine*/ false, /*Lifetime*/ 1.0f);
				}
#endif
			}
		}