r.HLOD.DistanceOverrideScale
r.HLOD.DistanceOverrideScale
#Overview
name: r.HLOD.DistanceOverrideScale
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Scales the value in r.HLOD.DistanceOverride, Default off.\nThis is an optional scale intended to allow game logic to dynamically modify without impacting scalability.\n
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.HLOD.DistanceOverrideScale is to provide a scaling factor for the HLOD (Hierarchical Level of Detail) distance override values. It allows for dynamic modification of HLOD distances without affecting the base scalability settings.
This setting variable is primarily used by the HLOD system, which is part of the rendering and performance optimization subsystems in Unreal Engine. It is specifically referenced in the LODActor module, which handles Level of Detail actors.
The value of this variable is set through the console variable system in Unreal Engine. It is defined as a TAutoConsoleVariable
This variable interacts closely with another console variable, r.HLOD.DistanceOverride. While r.HLOD.DistanceOverride sets the base distances for HLOD transitions, r.HLOD.DistanceOverrideScale provides an additional scaling factor to these distances.
Developers should be aware that:
- This variable accepts a string value, which can contain multiple scale factors separated by commas or spaces.
- It’s designed to allow game logic to dynamically modify HLOD distances without impacting the base scalability settings.
- The default value is an empty string, meaning no scaling is applied by default.
Best practices when using this variable include:
- Use it for runtime adjustments to HLOD distances, such as adapting to different gameplay scenarios or performance targets.
- Ensure that the scale values provided are appropriate and don’t negatively impact visual quality or performance.
- Consider using this in conjunction with other HLOD settings for fine-tuned control over LOD transitions.
Regarding the associated variable CVarHLODDistanceOverrideScale:
This is the actual console variable object that represents r.HLOD.DistanceOverrideScale in the code. It’s used to define the console variable and provide its description.
The purpose of CVarHLODDistanceOverrideScale is to serve as the programmatic interface for the r.HLOD.DistanceOverrideScale setting. It’s used within the engine code to access and modify the value of the setting.
This variable is part of the console variable system in Unreal Engine, which is used across various subsystems for configuration and runtime tweaking.
The value of this variable is typically set through the console or configuration files, but can also be modified programmatically.
It interacts directly with the HLOD system, particularly in the ParseOverrideDistancesCVar function of the ALODActor class.
Developers should be aware that:
- This variable stores its value as a string, which needs to be parsed when used.
- Changes to this variable will affect HLOD behavior at runtime.
Best practices when using this variable include:
- Access its value using the GetValueOnAnyThread() method when needed in code.
- Parse the string value appropriately, considering that it may contain multiple scale factors.
- Use it in conjunction with CVarHLODDistanceOverride for complete control over HLOD distances.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/LODActor.cpp:60
Scope: file
Source code excerpt:
static TAutoConsoleVariable<FString> CVarHLODDistanceOverrideScale(
TEXT("r.HLOD.DistanceOverrideScale"),
"",
TEXT("Scales the value in r.HLOD.DistanceOverride, Default off.\n")
TEXT("This is an optional scale intended to allow game logic to dynamically modify without impacting scalability.\n")
);
static TAutoConsoleVariable<int32> CVarHLODForceDisableCastDynamicShadow(
#Associated Variable and Callsites
This variable is associated with another variable named CVarHLODDistanceOverrideScale
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/LODActor.cpp:59
Scope: file
Source code excerpt:
ECVF_Scalability);
static TAutoConsoleVariable<FString> CVarHLODDistanceOverrideScale(
TEXT("r.HLOD.DistanceOverrideScale"),
"",
TEXT("Scales the value in r.HLOD.DistanceOverride, Default off.\n")
TEXT("This is an optional scale intended to allow game logic to dynamically modify without impacting scalability.\n")
);
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/LODActor.cpp:382
Scope (from outer to inner):
file
function void ALODActor::ParseOverrideDistancesCVar
Source code excerpt:
// Parse HLOD override distance cvar into array
const FString DistanceOverrideValues = CVarHLODDistanceOverride.GetValueOnAnyThread();
const FString DistanceOverrideScaleValues = CVarHLODDistanceOverrideScale.GetValueOnAnyThread();
const TCHAR* Delimiters[] = { TEXT(","), TEXT(" ") };
TArray<FString> Distances;
DistanceOverrideValues.ParseIntoArray(/*out*/ Distances, Delimiters, UE_ARRAY_COUNT(Delimiters), true);
TArray<FString> DistanceScales;