r.ProxyLODMeshReductionModule
r.ProxyLODMeshReductionModule
#Overview
name: r.ProxyLODMeshReductionModule
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Name of the Proxy LOD reduction module to choose. If blank it chooses any that exist.\n
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.ProxyLODMeshReductionModule is to specify the name of the Proxy LOD (Level of Detail) mesh reduction module to be used in Unreal Engine 5. This setting variable is primarily related to the mesh simplification and LOD generation system.
This setting variable is primarily used by the mesh reduction and LOD generation subsystems within Unreal Engine. Based on the callsites, it’s utilized in the MeshReductionInterface module and the Engine module, specifically in the context of HLOD (Hierarchical Level of Detail) and Proxy LOD mesh simplification.
The value of this variable is set in the engine configuration file (GEngineIni). It can be read from the “/Script/Engine.ProxyLODMeshSimplificationSettings” section of the config file.
This variable interacts with the ProxyLODMeshSimplificationSettings class, which is part of the engine’s mesh simplification settings. It’s used to set the mesh reduction module name for Proxy LOD generation.
Developers should be aware that this variable is marked as ECVF_ReadOnly, meaning it’s intended to be set in configuration files and not changed at runtime. Also, if the value is left blank, the engine will choose any available mesh reduction module.
Best practices when using this variable include:
- Setting it in the appropriate configuration file rather than trying to modify it at runtime.
- Ensuring that the specified mesh reduction module is actually available in your project.
- If you’re developing a custom mesh reduction module, make sure its name matches the one specified in this variable.
- Be aware that changing this variable could significantly impact the performance and quality of your game’s LOD system, so thorough testing is recommended after any modifications.
- If left empty, be prepared for the engine to choose a default module, which may not always be the optimal choice for your specific use case.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/ProxyLODMeshSimplificationSettings.cpp:7
Scope: file
Source code excerpt:
static FAutoConsoleVariable CVarProxyLODMeshReductionModule(
TEXT("r.ProxyLODMeshReductionModule"),
TEXT("ProxyLODMeshReduction"),
TEXT("Name of the Proxy LOD reduction module to choose. If blank it chooses any that exist.\n"),
ECVF_ReadOnly);
UProxyLODMeshSimplificationSettings::UProxyLODMeshSimplificationSettings(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
#Loc: <Workspace>/Engine/Source/Developer/MeshReductionInterface/Private/MeshReductionManagerModule.cpp:47
Scope (from outer to inner):
file
function void FMeshReductionManagerModule::StartupModule
Source code excerpt:
}
FString HLODMeshReductionModuleName;
if (GConfig->GetString(TEXT("/Script/Engine.ProxyLODMeshSimplificationSettings"), TEXT("r.ProxyLODMeshReductionModule"), HLODMeshReductionModuleName, GEngineIni))
{
ProxyLODMeshSimplificationSettings_CDO->SetProxyLODMeshReductionModuleName(*HLODMeshReductionModuleName);
}
}
// Get configured module names.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/HLODProxy.cpp:658
Scope (from outer to inner):
file
function FName UHLODProxy::GenerateKeyForActor
Source code excerpt:
// NOTE: This mimics code in the editor only FMeshReductionManagerModule::StartupModule(). If that changes then this should too
FString HLODMeshReductionModuleName;
GConfig->GetString(TEXT("/Script/Engine.ProxyLODMeshSimplificationSettings"), TEXT("r.ProxyLODMeshReductionModule"), HLODMeshReductionModuleName, GEngineIni);
// If nothing was requested, default to simplygon for mesh merging reduction
if (HLODMeshReductionModuleName.IsEmpty())
{
HLODMeshReductionModuleName = TEXT("SimplygonMeshReduction");
}