r.Lumen.IrradianceFieldGather.IrradianceProbeResolution

r.Lumen.IrradianceFieldGather.IrradianceProbeResolution

#Overview

name: r.Lumen.IrradianceFieldGather.IrradianceProbeResolution

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.Lumen.IrradianceFieldGather.IrradianceProbeResolution is to control the resolution of the probe’s 2D irradiance layout in Unreal Engine 5’s Lumen Global Illumination system.

This setting variable is primarily used in the Lumen subsystem, specifically in the Irradiance Field Gather component of the rendering system. It’s part of the Renderer module in Unreal Engine 5.

The value of this variable is set through the Unreal Engine console variable system. It’s defined as an FAutoConsoleVariableRef, which means it can be changed at runtime through console commands or configuration files.

The variable interacts directly with GLumenIrradianceFieldProbeIrradianceResolution, which is the C++ integer variable that stores the actual value. They share the same value, with the console variable providing an interface to modify it.

Developers should be aware that this variable affects the quality and performance of the Lumen Global Illumination system. A higher resolution will provide more detailed irradiance information but at the cost of increased memory usage and potentially lower performance.

Best practices when using this variable include:

  1. Balancing quality and performance based on the target hardware.
  2. Testing different values to find the optimal setting for your specific scene.
  3. Considering the relationship between this value and other Lumen settings for overall GI quality.

Regarding the associated variable GLumenIrradianceFieldProbeIrradianceResolution:

The purpose of GLumenIrradianceFieldProbeIrradianceResolution is to store the actual integer value of the irradiance probe resolution used in the Lumen Irradiance Field Gather calculations.

This variable is used directly in the Lumen subsystem, specifically in the LumenIrradianceFieldGather namespace within the Renderer module.

The value of this variable is set by the console variable r.Lumen.IrradianceFieldGather.IrradianceProbeResolution, and it’s initialized with a default value of 6.

It interacts with other Lumen settings, particularly in the SetupRadianceCacheInputs function where it’s used to set the IrradianceProbeResolution parameter.

Developers should be aware that modifying this variable directly in code will not persist changes, as it will be overwritten by the console variable system. Always use the console variable to change this setting.

Best practices for this variable include:

  1. Treating it as read-only in most code contexts.
  2. Using it to read the current irradiance probe resolution in Lumen-related calculations.
  3. Considering its value when optimizing Lumen performance and quality.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenIrradianceFieldGather.cpp:71

Scope: file

Source code excerpt:

int32 GLumenIrradianceFieldProbeIrradianceResolution = 6;
FAutoConsoleVariableRef CVarLumenIrradianceFieldProbeIrradianceResolution(
	TEXT("r.Lumen.IrradianceFieldGather.IrradianceProbeResolution"),
	GLumenIrradianceFieldProbeIrradianceResolution,
	TEXT("Resolution of the probe's 2d irradiance layout."),
	ECVF_RenderThreadSafe
);

int32 GLumenIrradianceFieldProbeOcclusionResolution = 16;

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenIrradianceFieldGather.cpp:69

Scope: file

Source code excerpt:

);

int32 GLumenIrradianceFieldProbeIrradianceResolution = 6;
FAutoConsoleVariableRef CVarLumenIrradianceFieldProbeIrradianceResolution(
	TEXT("r.Lumen.IrradianceFieldGather.IrradianceProbeResolution"),
	GLumenIrradianceFieldProbeIrradianceResolution,
	TEXT("Resolution of the probe's 2d irradiance layout."),
	ECVF_RenderThreadSafe
);

int32 GLumenIrradianceFieldProbeOcclusionResolution = 16;
FAutoConsoleVariableRef CVarLumenIrradianceFieldProbeOcclusionResolution(

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenIrradianceFieldGather.cpp:140

Scope (from outer to inner):

file
namespace    LumenIrradianceFieldGather
function     LumenRadianceCache::FRadianceCacheInputs SetupRadianceCacheInputs

Source code excerpt:

		Parameters.FinalRadianceAtlasMaxMip = GLumenIrradianceFieldNumMipmaps - 1;
		Parameters.CalculateIrradiance = 1;
		Parameters.IrradianceProbeResolution = GLumenIrradianceFieldProbeIrradianceResolution;
		Parameters.OcclusionProbeResolution = GLumenIrradianceFieldProbeOcclusionResolution;
		Parameters.NumProbesToTraceBudget = GLumenIrradianceFieldNumProbesToTraceBudget;
		Parameters.RadianceCacheStats = GLumenIrradianceFieldStats;
		return Parameters;
	}
}