wp.Runtime.HLOD.WarmupNanite
wp.Runtime.HLOD.WarmupNanite
#Overview
name: wp.Runtime.HLOD.WarmupNanite
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Enable Nanite 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.WarmupNanite is to enable or disable the Nanite warmup for HLOD (Hierarchical Level of Detail) assets in Unreal Engine 5. This setting is part of the HLOD system, which is used for optimizing rendering performance in large open-world environments.
This setting variable is primarily used by the World Partition HLOD Runtime Subsystem, which is part of the Engine module. It’s specifically related to the rendering and optimization systems within Unreal Engine 5.
The value of this variable is set through a console variable (CVarHLODWarmupNanite) with a default value of 1 (enabled). It can be changed at runtime through console commands or programmatically.
This variable interacts closely with other HLOD-related settings, particularly:
- wp.Runtime.HLOD.WarmupEnabled: The Nanite warmup only occurs if this main warmup flag is also enabled.
- wp.Runtime.HLOD.WarmupVT: A similar setting for virtual texture warmup.
- wp.Runtime.HLOD.WarmupNumFrames: Determines the number of frames for the warmup process.
Developers should be aware that:
- This setting only takes effect if the main HLOD warmup (wp.Runtime.HLOD.WarmupEnabled) is also enabled.
- It’s specifically for Nanite-enabled HLOD assets.
- The warmup process can impact performance during initial loading or streaming, but aims to improve performance afterwards.
Best practices when using this variable include:
- Ensure it’s enabled for projects using Nanite and HLOD for large environments.
- Test performance with and without this setting to determine its impact on your specific project.
- Consider disabling it for development builds to reduce initial loading times, but keep it enabled for shipping builds.
Regarding the associated variable CVarHLODWarmupNanite:
This is the actual console variable that controls the wp.Runtime.HLOD.WarmupNanite setting. It’s defined as a TAutoConsoleVariable
When working with CVarHLODWarmupNanite, developers should:
- Use CVarHLODWarmupNanite.GetValueOnGameThread() to safely read its current value.
- Be aware that changing this value at runtime will immediately affect the HLOD warmup behavior.
- Consider exposing this setting in your game’s graphics options if you want to give users control over this performance optimization.
#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:47
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarHLODWarmupNanite(
TEXT("wp.Runtime.HLOD.WarmupNanite"),
1,
TEXT("Enable Nanite warmup for HLOD assets. Requires wp.Runtime.HLOD.WarmupEnabled to be 1."));
static TAutoConsoleVariable<int32> CVarHLODWarmupNumFrames(
TEXT("wp.Runtime.HLOD.WarmupNumFrames"),
5,
#Associated Variable and Callsites
This variable is associated with another variable named CVarHLODWarmupNanite
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/WorldPartition/HLOD/HLODRuntimeSubsystem.cpp:46
Scope: file
Source code excerpt:
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,
TEXT("Enable Nanite warmup for HLOD assets. Requires wp.Runtime.HLOD.WarmupEnabled to be 1."));
static TAutoConsoleVariable<int32> CVarHLODWarmupNumFrames(
TEXT("wp.Runtime.HLOD.WarmupNumFrames"),
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/WorldPartition/HLOD/HLODRuntimeSubsystem.cpp:502
Scope (from outer to inner):
file
function bool UWorldPartitionHLODRuntimeSubsystem::ShouldPerformWarmup
Source code excerpt:
const bool bNaniteEnabled = UseNanite(ShaderPlatform);
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:659
Scope (from outer to inner):
file
function void UWorldPartitionHLODRuntimeSubsystem::OnBeginRenderViews
Source code excerpt:
TMap<Nanite::FResources*, int32> NaniteRequests;
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();