r.LumenScene.GlobalSDF.ClipmapExtent

r.LumenScene.GlobalSDF.ClipmapExtent

#Overview

name: r.LumenScene.GlobalSDF.ClipmapExtent

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.LumenScene.GlobalSDF.ClipmapExtent is to control the extent of the first clipmap in the Global Distance Field when Lumen is enabled. This setting is part of the Lumen global illumination system in Unreal Engine 5’s rendering pipeline.

This setting variable is primarily used in the Lumen subsystem of Unreal Engine’s rendering module. Based on the callsites, it’s specifically utilized in the LumenScene component.

The value of this variable is set through the console variable system in Unreal Engine. It’s initialized with a default value of 2500.0f and can be modified at runtime using console commands.

The variable interacts directly with GLumenSceneGlobalDFClipmapExtent, which is the C++ variable that stores the actual value. They share the same value, with r.LumenScene.GlobalSDF.ClipmapExtent acting as the console-accessible interface to modify GLumenSceneGlobalDFClipmapExtent.

Developers should be aware that this variable affects the size of the first clipmap in the Global Distance Field, which can impact both rendering quality and performance. Changing this value will affect the coverage of the global illumination system, potentially influencing visual fidelity and computational cost.

Best practices when using this variable include:

  1. Adjusting it based on the scale of your scene. Larger scenes may benefit from a larger clipmap extent.
  2. Balancing it with performance considerations, as larger values may increase computational load.
  3. Testing different values to find the optimal balance between visual quality and performance for your specific project.

Regarding GLumenSceneGlobalDFClipmapExtent:

The purpose of GLumenSceneGlobalDFClipmapExtent is to store the actual value of the Global Distance Field’s first clipmap extent when Lumen is enabled. It’s the C++ variable that directly influences the Lumen system’s behavior.

This variable is used in the Lumen subsystem of the rendering module, specifically in the LumenScene component. It’s accessed in the GetGlobalDFClipmapExtent function, which suggests it’s used to calculate the extent of different clipmap levels in the Global Distance Field.

The value of GLumenSceneGlobalDFClipmapExtent is set through the r.LumenScene.GlobalSDF.ClipmapExtent console variable. It’s initialized with a default value of 2500.0f.

GLumenSceneGlobalDFClipmapExtent interacts directly with the r.LumenScene.GlobalSDF.ClipmapExtent console variable, serving as the actual storage for the value set through the console.

Developers should be aware that modifying GLumenSceneGlobalDFClipmapExtent directly in code is not recommended. Instead, they should use the r.LumenScene.GlobalSDF.ClipmapExtent console variable to ensure proper synchronization and thread safety.

Best practices for GLumenSceneGlobalDFClipmapExtent include:

  1. Avoiding direct modification in code; use the console variable instead.
  2. Considering its impact on the entire clipmap hierarchy when adjusting its value.
  3. Monitoring its effect on both visual quality and performance when changed.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScene.cpp:17

Scope: file

Source code excerpt:

float GLumenSceneGlobalDFClipmapExtent = 2500.0f;
FAutoConsoleVariableRef CVarLumenSceneGlobalDFClipmapExtent(
	TEXT("r.LumenScene.GlobalSDF.ClipmapExtent"),
	GLumenSceneGlobalDFClipmapExtent,
	TEXT("Global Distance Field first clipmap extent when Lumen is enabled."),
	ECVF_RenderThreadSafe
);

static TAutoConsoleVariable<int32> CVarLumenFarField(

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScene.cpp:15

Scope: file

Source code excerpt:

);

float GLumenSceneGlobalDFClipmapExtent = 2500.0f;
FAutoConsoleVariableRef CVarLumenSceneGlobalDFClipmapExtent(
	TEXT("r.LumenScene.GlobalSDF.ClipmapExtent"),
	GLumenSceneGlobalDFClipmapExtent,
	TEXT("Global Distance Field first clipmap extent when Lumen is enabled."),
	ECVF_RenderThreadSafe
);

static TAutoConsoleVariable<int32> CVarLumenFarField(
	TEXT("r.LumenScene.FarField"), 0,

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScene.cpp:117

Scope (from outer to inner):

file
function     float Lumen::GetGlobalDFClipmapExtent

Source code excerpt:

float Lumen::GetGlobalDFClipmapExtent(int32 ClipmapIndex)
{
	return GLumenSceneGlobalDFClipmapExtent * FMath::Pow(2.0f, ClipmapIndex);
}

int32 Lumen::GetNumGlobalDFClipmaps(const FSceneView& View)
{
	return GlobalDistanceField::GetNumGlobalDistanceFieldClipmaps(/*bLumenEnabled*/ true, View.FinalPostProcessSettings.LumenSceneViewDistance);
}