r.ProxyLODChartColorVerts

r.ProxyLODChartColorVerts

#Overview

name: r.ProxyLODChartColorVerts

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.ProxyLODChartColorVerts is to control the coloring of vertices in the Proxy LOD (Level of Detail) system based on their UV chart assignments. This setting is specifically related to the rendering and mesh optimization aspects of Unreal Engine.

This setting variable is primarily used by the ProxyLODPlugin, which is part of the Editor plugins in Unreal Engine 5. The plugin is responsible for creating simplified, proxy versions of complex meshes for better performance.

The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of 0 (disabled) but can be changed at runtime or through configuration files.

The associated variable CVarProxyLODChartColorVerts directly interacts with r.ProxyLODChartColorVerts. They share the same value and purpose.

Developers should be aware that:

  1. This variable is a boolean flag (0 or 1).
  2. When enabled (set to 1), it will add vertex colors to the output mesh corresponding to different charts in the UV atlas.
  3. This feature is primarily used for debugging or visualization purposes, as it helps to visually distinguish different UV charts.

Best practices when using this variable include:

  1. Keep it disabled (0) for release builds to avoid unnecessary vertex color data.
  2. Enable it (1) when debugging UV layout issues or when you need to visualize the UV chart distribution on your proxy LOD meshes.
  3. Be aware that enabling this feature may increase memory usage and potentially impact performance, so use it judiciously.

Regarding the associated variable CVarProxyLODChartColorVerts:

Developers should treat CVarProxyLODChartColorVerts as the internal representation of r.ProxyLODChartColorVerts and use the appropriate Unreal Engine CVar interfaces to modify or query its value rather than accessing it directly.

#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:55

Scope: file

Source code excerpt:

// to the different charts in the uv-atlas.
static TAutoConsoleVariable<int32> CVarProxyLODChartColorVerts(
	TEXT("r.ProxyLODChartColorVerts"),
	0,
	TEXT("Color verts by uv chart.  Default off.\n")
	TEXT("0: Disabled \n")
	TEXT("1: Enabled."),
	ECVF_Default);

#Associated Variable and Callsites

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

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

Scope: file

Source code excerpt:

// Allow for adding vertex colors to the output mesh that correspond
// to the different charts in the uv-atlas.
static TAutoConsoleVariable<int32> CVarProxyLODChartColorVerts(
	TEXT("r.ProxyLODChartColorVerts"),
	0,
	TEXT("Color verts by uv chart.  Default off.\n")
	TEXT("0: Disabled \n")
	TEXT("1: Enabled."),
	ECVF_Default);

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

Scope (from outer to inner):

file
function     void FVoxelizeMeshMerging::CaptureCVars

Source code excerpt:

		int32 RayOrder                 = CVarProxyLODTransfer.GetValueOnGameThread();
		int32 DilationSteps            = CVarProxyLODMaxDilationSteps.GetValueOnGameThread();
		bool bAddChartColorVerts       = (CVarProxyLODChartColorVerts.GetValueOnGameThread() == 1);
		bool bUseTrueTangentSpace      = (CVarProxyLODUseTangentSpace.GetValueOnGameThread() == 1);
		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.