wp.Runtime.HLOD.WarmupVT
wp.Runtime.HLOD.WarmupVT
#Overview
name: wp.Runtime.HLOD.WarmupVT
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Enable virtual texture warmup for HLOD assets. Requires wp.Runtime.HLOD.WarmupEnabled to be 1.
It is referenced in 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of wp.Runtime.HLOD.WarmupVT is to enable virtual texture warmup for HLOD (Hierarchical Level of Detail) assets in Unreal Engine 5. This setting is part of the HLOD system, which is used to improve rendering performance for large, complex scenes.
This setting variable is primarily used in the WorldPartition and HLOD subsystems of Unreal Engine 5. It is referenced in the HLODRuntimeSubsystem, which is responsible for managing HLOD assets at runtime.
The value of this variable is set through a console variable (CVar) named CVarHLODWarmupVT. It is initialized with a default value of 1, meaning the feature is enabled by default. Users can modify this value at runtime using console commands.
This variable interacts closely with other HLOD-related variables, particularly:
- wp.Runtime.HLOD.WarmupEnabled: The main switch for HLOD warmup functionality.
- wp.Runtime.HLOD.WarmupNanite: Controls Nanite warmup for HLOD assets.
Developers must be aware that:
- This setting only takes effect if wp.Runtime.HLOD.WarmupEnabled is set to 1.
- It works in conjunction with the virtual texturing system and may affect performance and memory usage.
- The warmup process delays the unloading of cells and transition to HLODs for a specified number of frames.
Best practices when using this variable include:
- Ensure that virtual texturing is enabled for the target platform.
- Monitor performance impacts and adjust the warmup duration if necessary.
- Consider disabling this feature on lower-end hardware if performance is an issue.
Regarding the associated variable CVarHLODWarmupVT:
The purpose of CVarHLODWarmupVT is to provide a programmatic interface to control the wp.Runtime.HLOD.WarmupVT setting. It is an instance of TAutoConsoleVariable
This variable is used in the HLODRuntimeSubsystem to determine whether virtual texture warmup should be performed. It’s checked in methods like ShouldPerformWarmup() and OnBeginRenderViews() to control the HLOD warmup behavior.
The value of CVarHLODWarmupVT is set when the console variable is initialized, but it can be changed at runtime through console commands.
CVarHLODWarmupVT interacts with other variables like CVarHLODWarmupNanite and is used in conjunction with checks for virtual texturing and Nanite availability.
Developers should be aware that:
- The value of this variable is retrieved using GetValueOnGameThread(), which ensures thread-safe access.
- Changes to this variable will affect the HLOD system’s behavior in real-time.
Best practices for using CVarHLODWarmupVT include:
- Use it in conjunction with other HLOD-related settings for comprehensive control over the HLOD system.
- Consider exposing this setting in the game’s options menu for user customization, if appropriate for your project.
- Monitor its impact on performance and adjust as necessary during development and optimization phases.
#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:42
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarHLODWarmupVT(
TEXT("wp.Runtime.HLOD.WarmupVT"),
1,
TEXT("Enable virtual texture warmup for HLOD assets. Requires wp.Runtime.HLOD.WarmupEnabled to be 1."));
static TAutoConsoleVariable<int32> CVarHLODWarmupNanite(
TEXT("wp.Runtime.HLOD.WarmupNanite"),
1,
#Associated Variable and Callsites
This variable is associated with another variable named CVarHLODWarmupVT
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/WorldPartition/HLOD/HLODRuntimeSubsystem.cpp:41
Scope: file
Source code excerpt:
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,
TEXT("Enable virtual texture warmup for HLOD assets. Requires wp.Runtime.HLOD.WarmupEnabled to be 1."));
static TAutoConsoleVariable<int32> CVarHLODWarmupNanite(
TEXT("wp.Runtime.HLOD.WarmupNanite"),
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/WorldPartition/HLOD/HLODRuntimeSubsystem.cpp:503
Scope (from outer to inner):
file
function bool UWorldPartitionHLODRuntimeSubsystem::ShouldPerformWarmup
Source code excerpt:
const bool bVirtualTextureEnabled = UseVirtualTexturing(ShaderPlatform);
const bool bWarmupNanite = CVarHLODWarmupNanite.GetValueOnGameThread() != 0;
const bool bWarmupVT = CVarHLODWarmupVT.GetValueOnGameThread() != 0;
const bool bWarmupNeeded = (bNaniteEnabled && bWarmupNanite) || (bVirtualTextureEnabled && bWarmupVT);
if (!bWarmupNeeded)
{
return false;
}
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/WorldPartition/HLOD/HLODRuntimeSubsystem.cpp:660
Scope (from outer to inner):
file
function void UWorldPartitionHLODRuntimeSubsystem::OnBeginRenderViews
Source code excerpt:
const bool bWarmupNanite = CVarHLODWarmupNanite.GetValueOnGameThread() != 0;
const bool bWarmupVT = CVarHLODWarmupVT.GetValueOnGameThread() != 0;
for (FHLODWarmupStateMap::TIterator HLODActorWarmupStateIt(HLODActorsToWarmup); HLODActorWarmupStateIt; ++HLODActorWarmupStateIt)
{
const FObjectKey& HLODActorObjectKey = HLODActorWarmupStateIt.Key();
FWorldPartitionHLODWarmupState& HLODWarmupState = HLODActorWarmupStateIt.Value();
const AWorldPartitionHLOD* HLODActor = Cast<AWorldPartitionHLOD>(HLODActorObjectKey.ResolveObjectPtr());