r.LumenScene.Radiosity.ProbeSpacing

r.LumenScene.Radiosity.ProbeSpacing

#Overview

name: r.LumenScene.Radiosity.ProbeSpacing

The value of this variable can be defined or overridden in .ini config files. 3 .ini config files referencing this setting variable.

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.Radiosity.ProbeSpacing is to control the spacing between radiosity probes in the Lumen global illumination system of Unreal Engine 5. This setting variable is related to the rendering system, specifically the Lumen radiosity component.

This setting variable is primarily used in the Lumen radiosity subsystem, which is part of the Renderer module in Unreal Engine 5. Based on the callsites, it’s clear that this variable is used in the LumenRadiosity namespace and related functions.

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

The associated variable GLumenRadiosityProbeSpacing interacts directly with r.LumenScene.Radiosity.ProbeSpacing. They share the same value, with GLumenRadiosityProbeSpacing being the actual variable used in the C++ code to determine the probe spacing.

Developers must be aware that this variable affects the distance between radiosity probes in Surface Cache texels. Changing this value will impact the density of the radiosity probe grid, which in turn affects the quality and performance of the global illumination calculations.

Best practices when using this variable include:

  1. Understanding that lower values will increase probe density, potentially improving lighting quality at the cost of performance.
  2. Higher values will decrease probe density, improving performance but potentially reducing lighting quality.
  3. Consider adjusting this value based on the scene complexity and desired balance between quality and performance.
  4. Be aware that the actual probe spacing can be halved for high-quality settings (when LumenSceneLightingQuality is 6 or higher).

Regarding the associated variable GLumenRadiosityProbeSpacing:

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/BaseScalability.ini:274, section: [GlobalIlluminationQuality@2]

Location: <Workspace>/Engine/Config/BaseScalability.ini:297, section: [GlobalIlluminationQuality@3]

Location: <Workspace>/Engine/Config/BaseScalability.ini:321, section: [GlobalIlluminationQuality@Cine]

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenRadiosity.cpp:25

Scope: file

Source code excerpt:

int32 GLumenRadiosityProbeSpacing = 4;
FAutoConsoleVariableRef CVarLumenRadiosityProbeSpacing(
	TEXT("r.LumenScene.Radiosity.ProbeSpacing"),
	GLumenRadiosityProbeSpacing,
	TEXT("Distance between probes, in Surface Cache texels"),
	ECVF_Scalability | ECVF_RenderThreadSafe
);

int32 GLumenRadiosityHemisphereProbeResolution = 4;

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenRadiosity.cpp:23

Scope: file

Source code excerpt:

);

int32 GLumenRadiosityProbeSpacing = 4;
FAutoConsoleVariableRef CVarLumenRadiosityProbeSpacing(
	TEXT("r.LumenScene.Radiosity.ProbeSpacing"),
	GLumenRadiosityProbeSpacing,
	TEXT("Distance between probes, in Surface Cache texels"),
	ECVF_Scalability | ECVF_RenderThreadSafe
);

int32 GLumenRadiosityHemisphereProbeResolution = 4;
FAutoConsoleVariableRef CVarLumenRadiosityHemisphereProbeResolution(

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenRadiosity.cpp:187

Scope (from outer to inner):

file
namespace    LumenRadiosity
function     uint32 GetRadiosityProbeSpacing

Source code excerpt:

	uint32 GetRadiosityProbeSpacing(const FViewInfo& View)
	{
		int32 RadiosityProbeSpacing = GLumenRadiosityProbeSpacing;

		if (View.FinalPostProcessSettings.LumenSceneLightingQuality >= 6)
		{
			RadiosityProbeSpacing /= 2;
		}