r.ProxyLODCorrectCollapsedWalls

r.ProxyLODCorrectCollapsedWalls

#Overview

name: r.ProxyLODCorrectCollapsedWalls

This variable is created as a Console Variable (cvar).

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of r.ProxyLODCorrectCollapsedWalls is to control the behavior of the ProxyLOD system in correcting walls with interpenetrating faces. This setting is part of the ProxyLOD plugin, which is used for generating low-detail proxy meshes for distant or complex objects to improve rendering performance.

This setting variable is primarily used in the ProxyLOD plugin, which is part of the Unreal Engine’s editor tools for optimizing game assets. It’s specifically related to the mesh simplification and LOD (Level of Detail) generation process.

The value of this variable is set through a console command or configuration file. It’s defined as a TAutoConsoleVariable, which means it can be changed at runtime through the console or ini files.

The associated variable CVarProxyLODCorrectCollapsedWalls directly interacts with r.ProxyLODCorrectCollapsedWalls. They share the same value and purpose.

Developers must be aware that enabling this feature (setting the value to 1) may cause cracks in the resulting mesh. This is a trade-off between correcting interpenetrating faces and maintaining mesh integrity.

Best practices when using this variable include:

  1. Test thoroughly when enabling this feature to ensure the visual quality of your proxies is not compromised.
  2. Use in conjunction with other ProxyLOD settings to achieve the best balance between performance and visual fidelity.
  3. Consider leaving it disabled (0) by default and only enable it if you encounter specific issues with collapsed walls in your proxy meshes.

Regarding the associated variable CVarProxyLODCorrectCollapsedWalls:

The purpose of CVarProxyLODCorrectCollapsedWalls is identical to r.ProxyLODCorrectCollapsedWalls. It’s the actual console variable that controls the behavior of correcting collapsed walls in the ProxyLOD system.

This variable is used within the ProxyLOD plugin, specifically in the FVoxelizeMeshMerging class, which handles the mesh voxelization and merging process.

The value of CVarProxyLODCorrectCollapsedWalls is set when the console variable is initialized and can be accessed at runtime using GetValueOnGameThread().

It interacts directly with the r.ProxyLODCorrectCollapsedWalls setting, as they represent the same configuration option.

Developers should be aware that this variable is checked during the mesh processing pipeline, specifically in the CaptureCVars function of FVoxelizeMeshMerging.

Best practices for using CVarProxyLODCorrectCollapsedWalls include:

  1. Access the value using GetValueOnGameThread() to ensure thread-safety when reading the setting.
  2. Consider the performance implications of enabling this feature, as it may introduce additional processing steps in the ProxyLOD generation.
  3. Use in conjunction with other ProxyLOD settings like bVoxelizeAndRemeshOnly and bSingleThreadedSimplify for a comprehensive approach to proxy mesh generation.

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Plugins/Editor/ProxyLODPlugin/Source/ProxyLOD/Private/ProxyLODPlugin.cpp:74

Scope: file

Source code excerpt:

// Attempt to separate the sides of collapsed walls.
static TAutoConsoleVariable<int32> CVarProxyLODCorrectCollapsedWalls(
	TEXT("r.ProxyLODCorrectCollapsedWalls"),
	0,
	TEXT("Shall the ProxyLOD system attemp to correct walls with interpenetrating faces")
	TEXT("0: disabled (default)\n")
	TEXT("1: endable, may cause cracks."),
	ECVF_Default);

#Associated Variable and Callsites

This variable is associated with another variable named CVarProxyLODCorrectCollapsedWalls. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Plugins/Editor/ProxyLODPlugin/Source/ProxyLOD/Private/ProxyLODPlugin.cpp:73

Scope: file

Source code excerpt:


// Attempt to separate the sides of collapsed walls.
static TAutoConsoleVariable<int32> CVarProxyLODCorrectCollapsedWalls(
	TEXT("r.ProxyLODCorrectCollapsedWalls"),
	0,
	TEXT("Shall the ProxyLOD system attemp to correct walls with interpenetrating faces")
	TEXT("0: disabled (default)\n")
	TEXT("1: endable, may cause cracks."),
	ECVF_Default);

#Loc: <Workspace>/Engine/Plugins/Editor/ProxyLODPlugin/Source/ProxyLOD/Private/ProxyLODPlugin.cpp:420

Scope (from outer to inner):

file
function     void FVoxelizeMeshMerging::CaptureCVars

Source code excerpt:

		bool bVoxelizeAndRemeshOnly    = (CVarProxyLODRemeshOnly.GetValueOnGameThread() == 1);
		bool bSingleThreadedSimplify   = (CVarProxyLODSingleThreadSimplify.GetValueOnAnyThread() == 1);
		bool bWallCorreciton           = (CVarProxyLODCorrectCollapsedWalls.GetValueOnGameThread() == 1);

		// set values  - note, this class is a global (singleton) instance.
		this->RayHitOrder              = RayOrder;
		this->bChartColorVerts         = bAddChartColorVerts;
		this->bUseTangentSpace         = bUseTrueTangentSpace;
		this->bRemeshOnly              = bVoxelizeAndRemeshOnly;