r.MeshCardRepresentation.Debug.SurfelDirection

r.MeshCardRepresentation.Debug.SurfelDirection

#Overview

name: r.MeshCardRepresentation.Debug.SurfelDirection

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.MeshCardRepresentation.Debug.SurfelDirection is to debug the mesh card representation system by controlling the generation of cards for surfels pointing in a specific direction. This setting variable is part of the rendering system, specifically related to mesh card representation optimization.

This setting variable is primarily used in the Engine module, within the MeshCardRepresentation subsystem. The code referencing this variable is located in the MeshCardRepresentation.cpp file.

The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of -1 and can be changed at runtime using console commands.

The associated variable CVarCardRepresentationDebugSurfelDirection directly interacts with r.MeshCardRepresentation.Debug.SurfelDirection. They share the same value and purpose.

Developers must be aware that this variable is intended for debugging purposes. It allows for selective generation of cards based on surfel direction, which can be useful for isolating and examining specific parts of the mesh card representation.

Best practices when using this variable include:

  1. Use it only for debugging purposes, not in production code.
  2. Be aware that setting a value other than -1 will affect the normal behavior of the mesh card representation system.
  3. Remember to reset the value to -1 after debugging to restore normal functionality.
  4. Use in conjunction with other debugging tools to get a comprehensive view of the mesh card representation system.

Regarding the associated variable CVarCardRepresentationDebugSurfelDirection:

The purpose of CVarCardRepresentationDebugSurfelDirection is to provide a programmatic interface to the r.MeshCardRepresentation.Debug.SurfelDirection setting. It’s used within the engine code to access and modify the debug setting.

This variable is used in the Engine module, specifically within the MeshCardRepresentation class. It’s defined and used in the MeshCardRepresentation.cpp file.

The value of CVarCardRepresentationDebugSurfelDirection is set when the console variable r.MeshCardRepresentation.Debug.SurfelDirection is modified. It can be accessed in code using the GetValueOnAnyThread() method.

CVarCardRepresentationDebugSurfelDirection directly interacts with r.MeshCardRepresentation.Debug.SurfelDirection, as they represent the same setting.

Developers should be aware that this variable is an implementation detail of the console variable system. Direct manipulation of this variable should be avoided in favor of using the console command system to modify the setting.

Best practices for using CVarCardRepresentationDebugSurfelDirection include:

  1. Use GetValueOnAnyThread() to read the current value in a thread-safe manner.
  2. Avoid directly modifying this variable; instead, use the console command system to change the setting.
  3. When reading the value, use the GetDebugSurfelDirection() method of the MeshCardRepresentation class, which applies appropriate clamping to the raw value.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/MeshCardRepresentation.cpp:67

Scope: file

Source code excerpt:


static TAutoConsoleVariable<int32> CVarCardRepresentationDebugSurfelDirection(
	TEXT("r.MeshCardRepresentation.Debug.SurfelDirection"),
	-1,
	TEXT("Generate cards for only surfels pointing in a specific direction."),
	ECVF_Default);

float MeshCardRepresentation::GetMinDensity()
{

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/MeshCardRepresentation.cpp:66

Scope: file

Source code excerpt:

	ECVF_Cheat);

static TAutoConsoleVariable<int32> CVarCardRepresentationDebugSurfelDirection(
	TEXT("r.MeshCardRepresentation.Debug.SurfelDirection"),
	-1,
	TEXT("Generate cards for only surfels pointing in a specific direction."),
	ECVF_Default);

float MeshCardRepresentation::GetMinDensity()

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/MeshCardRepresentation.cpp:93

Scope (from outer to inner):

file
function     int32 MeshCardRepresentation::GetDebugSurfelDirection

Source code excerpt:

int32 MeshCardRepresentation::GetDebugSurfelDirection()
{
	return FMath::Clamp(CVarCardRepresentationDebugSurfelDirection.GetValueOnAnyThread(), -1, 5);
}

FCardRepresentationAsyncQueue* GCardRepresentationAsyncQueue = NULL;

#if WITH_EDITOR