wp.Runtime.HLOD.WarmupVTScaleFactor
wp.Runtime.HLOD.WarmupVTScaleFactor
#Overview
name: wp.Runtime.HLOD.WarmupVTScaleFactor
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Scale the VT size we ask to prefetch by this factor.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of wp.Runtime.HLOD.WarmupVTScaleFactor is to scale the size of virtual textures (VT) requested for prefetching in the HLOD (Hierarchical Level of Detail) system. This setting is used to optimize the loading and rendering of textures in large, open-world environments.
This setting variable is primarily used in the World Partition and HLOD subsystems of Unreal Engine 5. Specifically, it’s utilized in the HLODRuntimeSubsystem, which is part of the Engine module.
The value of this variable is set as a console variable with a default value of 2.0f. It can be modified at runtime through the console or in configuration files.
The associated variable CVarHLODWarmupVTScaleFactor directly interacts with wp.Runtime.HLOD.WarmupVTScaleFactor. They share the same value and purpose.
Developers should be aware that this variable affects the performance and memory usage of the HLOD system. Increasing the scale factor will result in larger texture requests, which can improve visual quality but may also increase memory usage and loading times.
Best practices when using this variable include:
- Adjusting it based on the specific needs of your project and target hardware.
- Balancing it with other HLOD settings for optimal performance.
- Testing different values to find the best trade-off between visual quality and performance.
Regarding the associated variable CVarHLODWarmupVTScaleFactor:
- It’s a TAutoConsoleVariable
that directly represents wp.Runtime.HLOD.WarmupVTScaleFactor in the C++ code. - It’s used in the PrepareVTRequests function to scale the pixel size of virtual texture requests.
- The scaled pixel size is then clamped using another variable, CVarHLODWarmupVTSizeClamp, to ensure it doesn’t exceed a maximum value.
- Developers should use this variable when they need to programmatically access or modify the HLOD warmup VT scale factor within C++ 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:62
Scope: file
Source code excerpt:
static TAutoConsoleVariable<float> CVarHLODWarmupVTScaleFactor(
TEXT("wp.Runtime.HLOD.WarmupVTScaleFactor"),
2.0f,
TEXT("Scale the VT size we ask to prefetch by this factor."));
static TAutoConsoleVariable<int32> CVarHLODWarmupVTSizeClamp(
TEXT("wp.Runtime.HLOD.WarmupVTSizeClamp"),
2048,
#Associated Variable and Callsites
This variable is associated with another variable named CVarHLODWarmupVTScaleFactor
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/WorldPartition/HLOD/HLODRuntimeSubsystem.cpp:61
Scope: file
Source code excerpt:
TEXT("Draw debug display for the warmup requests"));
static TAutoConsoleVariable<float> CVarHLODWarmupVTScaleFactor(
TEXT("wp.Runtime.HLOD.WarmupVTScaleFactor"),
2.0f,
TEXT("Scale the VT size we ask to prefetch by this factor."));
static TAutoConsoleVariable<int32> CVarHLODWarmupVTSizeClamp(
TEXT("wp.Runtime.HLOD.WarmupVTSizeClamp"),
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/WorldPartition/HLOD/HLODRuntimeSubsystem.cpp:415
Scope (from outer to inner):
file
function static void PrepareVTRequests
Source code excerpt:
// Assume the texture is wrapped around the object, so the screen size is actually less than the resolution we require.
PixelSize *= CVarHLODWarmupVTScaleFactor.GetValueOnAnyThread();
// Clamp for safety
PixelSize = FMath::Min(PixelSize, CVarHLODWarmupVTSizeClamp.GetValueOnAnyThread());
for (UMaterialInterface* MaterialInterface : InStaticMeshComponent->GetMaterials())
{