geometry.CombineInstances.Verbose
geometry.CombineInstances.Verbose
#Overview
name: geometry.CombineInstances.Verbose
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Enable Verbose logging in Combine Mesh Instances, also disables parallel LOD processing
It is referenced in 9
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of geometry.CombineInstances.Verbose
is to enable verbose logging in the Combine Mesh Instances functionality and disable parallel LOD processing. This setting variable is primarily used for debugging and performance analysis in the mesh combining process.
This setting variable is used within the Experimental MeshModelingToolsetExp plugin, specifically in the GeometryProcessingAdapters module. It is primarily utilized in the implementation of mesh instance combination functionality.
The value of this variable is set through the Unreal Engine console variable system. It is defined as a boolean value, defaulting to false.
The associated variable CVarGeometryCombineMeshInstancesVerbose
directly interacts with geometry.CombineInstances.Verbose
. They share the same value, and CVarGeometryCombineMeshInstancesVerbose
is used to access the setting throughout the code.
Developers must be aware that enabling this variable will increase logging output and potentially impact performance due to the disabling of parallel LOD processing. It should primarily be used for debugging and development purposes, not in production builds.
Best practices when using this variable include:
- Only enable it when necessary for debugging or analyzing the mesh combining process.
- Be prepared for increased log output and potentially slower performance when enabled.
- Disable it in production builds to ensure optimal performance.
- Use it in conjunction with other debugging tools to get a comprehensive understanding of the mesh combining process.
Regarding the associated variable CVarGeometryCombineMeshInstancesVerbose
:
- Its purpose is to provide easy access to the
geometry.CombineInstances.Verbose
setting within the C++ code. - It is used throughout the CombineMeshInstancesImpl.cpp file to check if verbose logging is enabled.
- The value is typically accessed using the
GetValueOnAnyThread()
method. - Developers should use this variable to conditionally execute verbose logging or modify behavior based on the verbose setting.
- Best practices include using it consistently throughout the relevant code to ensure uniform behavior when verbose mode is enabled.
#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:72
Scope: file
Source code excerpt:
static TAutoConsoleVariable<bool> CVarGeometryCombineMeshInstancesVerbose(
TEXT("geometry.CombineInstances.Verbose"),
false,
TEXT("Enable Verbose logging in Combine Mesh Instances, also disables parallel LOD processing"));
enum class EMeshDetailLevel
{
#Associated Variable and Callsites
This variable is associated with another variable named CVarGeometryCombineMeshInstancesVerbose
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Plugins/Experimental/MeshModelingToolsetExp/Source/GeometryProcessingAdapters/Private/CombineMeshInstancesImpl.cpp:71
Scope: file
Source code excerpt:
static TAutoConsoleVariable<bool> CVarGeometryCombineMeshInstancesVerbose(
TEXT("geometry.CombineInstances.Verbose"),
false,
TEXT("Enable Verbose logging in Combine Mesh Instances, also disables parallel LOD processing"));
enum class EMeshDetailLevel
#Loc: <Workspace>/Engine/Plugins/Experimental/MeshModelingToolsetExp/Source/GeometryProcessingAdapters/Private/CombineMeshInstancesImpl.cpp:1355
Scope (from outer to inner):
file
function void ComputeMeshApproximations
Source code excerpt:
CombineOptions.NumLODs - CombineOptions.NumCopiedLODs - CombineOptions.NumSimplifiedLODs);
bool bVerbose = CVarGeometryCombineMeshInstancesVerbose.GetValueOnAnyThread();
ParallelFor(NumParts, [&](int32 Index)
{
TUniquePtr<FMeshPart>& Part = Assembly.Parts[Index];
FSourceGeometry& SourceGeo = Assembly.SourceMeshGeometry[Index];
int32 NumSourceLODs = SourceGeo.SourceMeshLODs.Num();
const FDynamicMesh3* OptimizationSourceMesh = &SourceGeo.SourceMeshLODs.Last();
#Loc: <Workspace>/Engine/Plugins/Experimental/MeshModelingToolsetExp/Source/GeometryProcessingAdapters/Private/CombineMeshInstancesImpl.cpp:2321
Scope (from outer to inner):
file
function static void PostProcessHiddenFaceRemovedMesh
Source code excerpt:
TSet<int32>* SkipMaterialIDs = nullptr)
{
bool bVerbose = CVarGeometryCombineMeshInstancesVerbose.GetValueOnAnyThread();
// weld edges in case input was unwelded...
{
// currently FMergeCoincidentMeshEdges can break the mesh if it has bowties, remove
// them to work around the issue
FDynamicMeshEditor MeshEditor(&TargetMesh);
#Loc: <Workspace>/Engine/Plugins/Experimental/MeshModelingToolsetExp/Source/GeometryProcessingAdapters/Private/CombineMeshInstancesImpl.cpp:3060
Scope (from outer to inner):
file
function bool ComputeHiddenRemovalForLOD
Source code excerpt:
IGeometryProcessing_CombineMeshInstances::FOptions CombineOptions)
{
bool bVerbose = CVarGeometryCombineMeshInstancesVerbose.GetValueOnAnyThread();
TRACE_CPUPROFILER_EVENT_SCOPE(RemoveHidden_LOD);
bool bModified = false;
switch (CombineOptions.RemoveHiddenFacesMethod)
{
case IGeometryProcessing_CombineMeshInstances::ERemoveHiddenFacesMode::OcclusionBased:
#Loc: <Workspace>/Engine/Plugins/Experimental/MeshModelingToolsetExp/Source/GeometryProcessingAdapters/Private/CombineMeshInstancesImpl.cpp:3093
Scope (from outer to inner):
file
function void OptimizeLODMeshTriangulation
Source code excerpt:
TSet<int32>* SkipMaterialIDs = nullptr)
{
bool bVerbose = CVarGeometryCombineMeshInstancesVerbose.GetValueOnAnyThread();
TFunction<FIndex3i(const FDynamicMesh3& Mesh, int32 TriangleID)> GroupingIDFunc = CombineOptions.TriangleGroupingIDFunc;
if (!GroupingIDFunc)
{
GroupingIDFunc = [](const FDynamicMesh3&, int32) { return FIndex3i::Zero(); };
}
#Loc: <Workspace>/Engine/Plugins/Experimental/MeshModelingToolsetExp/Source/GeometryProcessingAdapters/Private/CombineMeshInstancesImpl.cpp:3124
Scope (from outer to inner):
file
function void ProcessCombinedLODChain
Source code excerpt:
{
using namespace UE::Geometry;
bool bVerbose = CVarGeometryCombineMeshInstancesVerbose.GetValueOnAnyThread();
int32 NumLODs = CombineOptions.NumLODs;
TArray<UE::Tasks::FTask> PendingRemoveHiddenTasks;
bool bRemoveHiddenFaces =
(CombineOptions.RemoveHiddenFacesMethod != IGeometryProcessing_CombineMeshInstances::ERemoveHiddenFacesMode::None
#Loc: <Workspace>/Engine/Plugins/Experimental/MeshModelingToolsetExp/Source/GeometryProcessingAdapters/Private/CombineMeshInstancesImpl.cpp:3385
Scope (from outer to inner):
file
function void BuildCombinedMesh
Source code excerpt:
{
using namespace UE::Geometry;
bool bVerbose = CVarGeometryCombineMeshInstancesVerbose.GetValueOnAnyThread();
int32 NumLODs = CombineOptions.NumLODs;
TArray<FCombinedMeshLOD> MeshLODs;
MeshLODs.SetNum(NumLODs);
int FirstVoxWrappedIndex = 9999;
#Loc: <Workspace>/Engine/Plugins/Experimental/MeshModelingToolsetExp/Source/GeometryProcessingAdapters/Private/CombineMeshInstancesImpl.cpp:3924
Scope (from outer to inner):
file
function void FCombineMeshInstancesImpl::CombineMeshInstances
Source code excerpt:
TRACE_CPUPROFILER_EVENT_SCOPE(CombineMeshInstances);
bool bVerbose = CVarGeometryCombineMeshInstancesVerbose.GetValueOnAnyThread();
if (bVerbose)
{
int32 NumApproxLODs = FMath::Max(0, Options.NumLODs - Options.NumCopiedLODs - Options.NumSimplifiedLODs - Options.NumCoarseLODs);
UE_LOG(LogGeometry, Log, TEXT("CombineMeshInstances: processing %d Instances into %d LODs (%d Copied, %d Simplified, %d Approx, %d Coarse)"),
( MeshInstances.StaticMeshInstances.Num() + MeshInstances.MeshLODSetInstances.Num() ),
Options.NumLODs, Options.NumCopiedLODs, Options.NumSimplifiedLODs, NumApproxLODs, Options.NumCoarseLODs);