geometry.CombineInstances.DebugRemoveHiddenStrategy
geometry.CombineInstances.DebugRemoveHiddenStrategy
#Overview
name: geometry.CombineInstances.DebugRemoveHiddenStrategy
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Configure hidden-removal strategy via (temporary debug)
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of geometry.CombineInstances.DebugRemoveHiddenStrategy is to configure the hidden-removal strategy for combining mesh instances in Unreal Engine 5. This setting variable is part of the mesh modeling and geometry processing system.
This setting variable is primarily used in the Experimental MeshModelingToolsetExp plugin, specifically in the GeometryProcessingAdapters module. It’s referenced in the CombineMeshInstancesImpl.cpp file, which suggests it’s related to the process of combining multiple mesh instances into a single mesh.
The value of this variable is set using a console variable (CVar) system. It’s initialized with a default value of 1, but can be changed at runtime through console commands or configuration files.
This variable interacts closely with CVarGeometryCombineMeshInstancesRemoveHidden, which is an associated variable that shares the same value. The CVarGeometryCombineMeshInstancesRemoveHidden variable is used to determine whether hidden faces should be removed during the mesh combination process.
Developers must be aware that this is a debug setting, as indicated by the “DebugRemoveHiddenStrategy” in its name. It’s likely intended for development and debugging purposes rather than for use in production builds. The comment describes it as a “temporary debug” setting, suggesting it might be removed or changed in future versions.
Best practices when using this variable include:
- Use it primarily for debugging and development purposes.
- Be cautious about relying on it in production code, as it may change or be removed in future engine versions.
- Consider the performance implications of different hidden-removal strategies when adjusting this value.
Regarding the associated variable CVarGeometryCombineMeshInstancesRemoveHidden:
The purpose of CVarGeometryCombineMeshInstancesRemoveHidden is to control whether hidden faces should be removed when combining mesh instances. It’s used in conjunction with the RemoveHiddenFacesMethod option to determine if hidden face removal should be performed.
This variable is used in the ProcessCombinedLODChain function, which is likely part of the mesh combining process. It affects the behavior of the mesh combination algorithm, particularly for different Levels of Detail (LODs).
The value of this variable is accessed using the GetValueOnAnyThread() method, suggesting it can be queried from multiple threads.
Developers should be aware that:
- This variable directly affects the mesh combining process and can impact the final mesh output.
- It interacts with the RemoveHiddenFacesMethod option, so both should be considered together.
- The removal of hidden faces starts from a specific LOD (RemoveHiddenStartLOD), which developers can configure.
Best practices for using this variable include:
- Consider the trade-offs between mesh simplification (by removing hidden faces) and maintaining original mesh data.
- Test thoroughly with different LOD configurations to ensure desired results across all detail levels.
- Monitor performance impacts, as removing hidden faces could affect processing time and memory usage.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Plugins/Experimental/MeshModelingToolsetExp/Source/GeometryProcessingAdapters/Private/CombineMeshInstancesImpl.cpp:66
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int> CVarGeometryCombineMeshInstancesRemoveHidden(
TEXT("geometry.CombineInstances.DebugRemoveHiddenStrategy"),
1,
TEXT("Configure hidden-removal strategy via (temporary debug)"));
static TAutoConsoleVariable<bool> CVarGeometryCombineMeshInstancesVerbose(
TEXT("geometry.CombineInstances.Verbose"),
#Associated Variable and Callsites
This variable is associated with another variable named CVarGeometryCombineMeshInstancesRemoveHidden
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Plugins/Experimental/MeshModelingToolsetExp/Source/GeometryProcessingAdapters/Private/CombineMeshInstancesImpl.cpp:65
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int> CVarGeometryCombineMeshInstancesRemoveHidden(
TEXT("geometry.CombineInstances.DebugRemoveHiddenStrategy"),
1,
TEXT("Configure hidden-removal strategy via (temporary debug)"));
static TAutoConsoleVariable<bool> CVarGeometryCombineMeshInstancesVerbose(
#Loc: <Workspace>/Engine/Plugins/Experimental/MeshModelingToolsetExp/Source/GeometryProcessingAdapters/Private/CombineMeshInstancesImpl.cpp:3131
Scope (from outer to inner):
file
function void ProcessCombinedLODChain
Source code excerpt:
bool bRemoveHiddenFaces =
(CombineOptions.RemoveHiddenFacesMethod != IGeometryProcessing_CombineMeshInstances::ERemoveHiddenFacesMode::None
&& CVarGeometryCombineMeshInstancesRemoveHidden.GetValueOnAnyThread() > 0);
if (bRemoveHiddenFaces)
{
for (int32 LODIndex = CombineOptions.RemoveHiddenStartLOD; LODIndex < NumLODs && LODIndex < FirstVoxWrappedIndex; ++LODIndex)
{
if (MeshLODs[LODIndex].Mesh.TriangleCount() == 0) continue;