MeshMergeUtilities.UVGenerationMethod
MeshMergeUtilities.UVGenerationMethod
#Overview
name: MeshMergeUtilities.UVGenerationMethod
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
UV generation method when creating merged or proxy meshes\n0 - Engine default - (currently Patch Builder)\n1 - Legacy\n2 - UVAtlas\n3 - XAtlas\n4 - Patch Builder\n
It is referenced in 5
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of MeshMergeUtilities.UVGenerationMethod is to control the UV generation method when creating merged or proxy meshes in Unreal Engine 5. This setting variable is primarily used in the mesh merging and simplification processes, which are part of the engine’s optimization and Level of Detail (LOD) systems.
This setting variable is relied upon by the MeshMergeUtilities module and the WorldPartitionHLODUtilities plugin. Specifically, it’s used in the mesh merging and HLOD (Hierarchical Level of Detail) building processes.
The value of this variable is set through a console variable (CVar) named CVarMeshMergeUtilitiesUVGenerationMethod. It can be set to different integer values, each corresponding to a different UV generation method: 0 - Engine default (currently Patch Builder) 1 - Legacy 2 - UVAtlas 3 - XAtlas
This variable interacts with the FStaticMeshOperations::EGenerateUVMethod enum, which is used to determine the actual UV generation method in the mesh merging process.
Developers should be aware that changing this variable will affect the UV generation method used in mesh merging operations throughout the engine. This can impact the visual quality and performance of merged meshes, so it should be changed with caution and after thorough testing.
Best practices when using this variable include:
- Understanding the trade-offs between different UV generation methods in terms of quality and performance.
- Testing the impact of different settings on your specific use case before changing the default.
- Documenting any non-default settings used in your project for future reference.
The associated variable CVarMeshMergeUtilitiesUVGenerationMethod is the actual console variable that stores and manages the value of MeshMergeUtilities.UVGenerationMethod. It’s defined as a TAutoConsoleVariable
This associated variable is used directly in the GetUVGenerationMethodToUse() function to determine which UV generation method to use based on the current value of the console variable. This function translates the integer value of the console variable into the corresponding EGenerateUVMethod enum value.
When working with CVarMeshMergeUtilitiesUVGenerationMethod, developers should be aware that changes to this variable will take effect immediately and could affect ongoing mesh merge operations. It’s generally safer to set this value at the start of the application or between major processing steps, rather than during active mesh merging operations.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Developer/MeshMergeUtilities/Private/MeshMergeUtilities.cpp:90
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarMeshMergeUtilitiesUVGenerationMethod(
TEXT("MeshMergeUtilities.UVGenerationMethod"),
0,
TEXT("UV generation method when creating merged or proxy meshes\n"
"0 - Engine default - (currently Patch Builder)\n"
"1 - Legacy\n"
"2 - UVAtlas\n"
"3 - XAtlas\n"
#Loc: <Workspace>/Engine/Plugins/Editor/WorldPartitionHLODUtilities/Source/Private/WorldPartition/HLOD/Builders/HLODBuilderMeshMerge.cpp:55
Scope (from outer to inner):
file
function uint32 UHLODBuilderMeshMergeSettings::GetCRC
Source code excerpt:
Ar << MaterialBakingModuleCRC;
static const auto MeshMergeUtilitiesUVGenerationMethodCVar = IConsoleManager::Get().FindConsoleVariable(TEXT("MeshMergeUtilities.UVGenerationMethod"));
int32 MeshMergeUtilitiesUVGenerationMethod = (MeshMergeUtilitiesUVGenerationMethodCVar != nullptr) ? MeshMergeUtilitiesUVGenerationMethodCVar->GetInt() : 0;
Ar << MeshMergeUtilitiesUVGenerationMethod;
}
uint32 Hash = Ar.GetCrc();
#Loc: <Workspace>/Engine/Plugins/Editor/WorldPartitionHLODUtilities/Source/Private/WorldPartition/HLOD/Builders/HLODBuilderMeshSimplify.cpp:54
Scope (from outer to inner):
file
function uint32 UHLODBuilderMeshSimplifySettings::GetCRC
Source code excerpt:
Ar << MaterialBakingModuleCRC;
static const auto MeshMergeUtilitiesUVGenerationMethodCVar = IConsoleManager::Get().FindConsoleVariable(TEXT("MeshMergeUtilities.UVGenerationMethod"));
int32 MeshMergeUtilitiesUVGenerationMethod = (MeshMergeUtilitiesUVGenerationMethodCVar != nullptr) ? MeshMergeUtilitiesUVGenerationMethodCVar->GetInt() : 0;
Ar << MeshMergeUtilitiesUVGenerationMethod;
uint32 Hash = Ar.GetCrc();
if (HLODMaterial)
#Associated Variable and Callsites
This variable is associated with another variable named CVarMeshMergeUtilitiesUVGenerationMethod
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Developer/MeshMergeUtilities/Private/MeshMergeUtilities.cpp:89
Scope: file
Source code excerpt:
DEFINE_LOG_CATEGORY(LogMeshMerging);
static TAutoConsoleVariable<int32> CVarMeshMergeUtilitiesUVGenerationMethod(
TEXT("MeshMergeUtilities.UVGenerationMethod"),
0,
TEXT("UV generation method when creating merged or proxy meshes\n"
"0 - Engine default - (currently Patch Builder)\n"
"1 - Legacy\n"
"2 - UVAtlas\n"
#Loc: <Workspace>/Engine/Source/Developer/MeshMergeUtilities/Private/MeshMergeUtilities.cpp:101
Scope (from outer to inner):
file
function static FStaticMeshOperations::EGenerateUVMethod GetUVGenerationMethodToUse
Source code excerpt:
static FStaticMeshOperations::EGenerateUVMethod GetUVGenerationMethodToUse()
{
switch (CVarMeshMergeUtilitiesUVGenerationMethod.GetValueOnAnyThread())
{
case 1: return FStaticMeshOperations::EGenerateUVMethod::Legacy;
case 2: return FStaticMeshOperations::EGenerateUVMethod::UVAtlas;
case 3: return FStaticMeshOperations::EGenerateUVMethod::XAtlas;
case 4: return FStaticMeshOperations::EGenerateUVMethod::PatchBuilder;
default: return FStaticMeshOperations::EGenerateUVMethod::Default;