wp.Runtime.HLOD.WarmupEnabled
wp.Runtime.HLOD.WarmupEnabled
#Overview
name: wp.Runtime.HLOD.WarmupEnabled
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Enable HLOD assets warmup. Will delay unloading of cells & transition to HLODs for wp.Runtime.HLOD.WarmupNumFrames frames.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of wp.Runtime.HLOD.WarmupEnabled is to control the HLOD (Hierarchical Level of Detail) assets warmup feature in Unreal Engine 5. It is primarily used for the rendering system, specifically for managing the loading and unloading of HLOD assets.
This setting variable is relied upon by the World Partition HLOD Runtime Subsystem, which is part of the Engine module. It’s used to determine whether HLOD assets should undergo a warmup process before being fully utilized in the game.
The value of this variable is set as a console variable, with a default value of 1 (enabled). It can be modified at runtime through console commands or programmatically.
The associated variable CVarHLODWarmupEnabled interacts directly with wp.Runtime.HLOD.WarmupEnabled. It’s used to retrieve the current value of the setting in the game thread.
Developers must be aware that when this variable is enabled, it will delay the unloading of cells and the transition to HLODs for a specified number of frames (determined by another variable, wp.Runtime.HLOD.WarmupNumFrames). This can affect performance and memory usage during level transitions or when loading new areas of the world.
Best practices when using this variable include:
- Carefully consider the performance implications of enabling HLOD warmup, especially on lower-end hardware.
- Test thoroughly with both enabled and disabled states to ensure smooth gameplay in all scenarios.
- If enabled, tune the wp.Runtime.HLOD.WarmupNumFrames variable to find the optimal balance between smooth transitions and performance.
- Monitor memory usage when this feature is enabled, as it may temporarily increase memory consumption.
Regarding the associated variable CVarHLODWarmupEnabled:
The purpose of CVarHLODWarmupEnabled is to provide a programmatic interface to access the wp.Runtime.HLOD.WarmupEnabled setting within the C++ code of the engine.
This variable is used directly in the World Partition HLOD Runtime Subsystem to determine if HLOD warmup should be performed.
The value of CVarHLODWarmupEnabled is set automatically based on the wp.Runtime.HLOD.WarmupEnabled console variable.
It interacts primarily with the ShouldPerformWarmup function in the UWorldPartitionHLODRuntimeSubsystem class.
Developers should be aware that this variable is accessed using the GetValueOnGameThread() method, which ensures thread-safe access to the current value.
Best practices for using CVarHLODWarmupEnabled include:
- Always use the GetValueOnGameThread() method when accessing its value to ensure thread safety.
- Consider caching the value if it’s accessed frequently in performance-critical code sections.
- Be aware that changes to this variable at runtime will affect HLOD behavior, which could impact performance and visual quality.
#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:37
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarHLODWarmupEnabled(
TEXT("wp.Runtime.HLOD.WarmupEnabled"),
1,
TEXT("Enable HLOD assets warmup. Will delay unloading of cells & transition to HLODs for wp.Runtime.HLOD.WarmupNumFrames frames."));
static TAutoConsoleVariable<int32> CVarHLODWarmupVT(
TEXT("wp.Runtime.HLOD.WarmupVT"),
1,
#Associated Variable and Callsites
This variable is associated with another variable named CVarHLODWarmupEnabled
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/WorldPartition/HLOD/HLODRuntimeSubsystem.cpp:36
Scope: file
Source code excerpt:
DEFINE_LOG_CATEGORY_STATIC(LogHLODRuntimeSubsystem, Log, All);
static TAutoConsoleVariable<int32> CVarHLODWarmupEnabled(
TEXT("wp.Runtime.HLOD.WarmupEnabled"),
1,
TEXT("Enable HLOD assets warmup. Will delay unloading of cells & transition to HLODs for wp.Runtime.HLOD.WarmupNumFrames frames."));
static TAutoConsoleVariable<int32> CVarHLODWarmupVT(
TEXT("wp.Runtime.HLOD.WarmupVT"),
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/WorldPartition/HLOD/HLODRuntimeSubsystem.cpp:486
Scope (from outer to inner):
file
function bool UWorldPartitionHLODRuntimeSubsystem::ShouldPerformWarmup
Source code excerpt:
{
// Test if warmup is disabled globally.
const bool bWarmupEnabled = CVarHLODWarmupEnabled.GetValueOnGameThread() != 0;
if (!bWarmupEnabled)
{
return false;
}
// If warmup num of frames is invalid, no warmup needed