r.Lumen.IrradianceFieldGather.ProbeResolution

r.Lumen.IrradianceFieldGather.ProbeResolution

#Overview

name: r.Lumen.IrradianceFieldGather.ProbeResolution

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.ProbeResolution is to control the resolution of the probe’s 2D radiance layout in Unreal Engine 5’s Lumen global illumination system. It specifically affects the Irradiance Field Gather component of Lumen.

This setting variable is primarily used in the Lumen subsystem of Unreal Engine’s rendering module. It’s referenced in the LumenIrradianceFieldGather.cpp file, which is part of the Renderer module.

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

The associated variable GLumenIrradianceFieldProbeResolution directly interacts with r.Lumen.IrradianceFieldGather.ProbeResolution. They share the same value, and GLumenIrradianceFieldProbeResolution is used in the actual rendering code.

Developers should be aware that this variable directly affects the number of rays traced for each probe. The number of rays is calculated as the square of the ProbeResolution value. This means that increasing the resolution will significantly increase the computational cost of the irradiance field gathering process.

Best practices when using this variable include:

  1. Balancing between quality and performance. Higher values will provide more accurate lighting but at the cost of performance.
  2. Testing different values to find the optimal setting for your specific scene and performance targets.
  3. Consider adjusting this value dynamically based on the scene complexity or distance from the camera.

Regarding the associated variable GLumenIrradianceFieldProbeResolution:

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

Scope: file

Source code excerpt:

int32 GLumenIrradianceFieldProbeResolution = 16;
FAutoConsoleVariableRef CVarLumenIrradianceFieldProbeResolution(
	TEXT("r.Lumen.IrradianceFieldGather.ProbeResolution"),
	GLumenIrradianceFieldProbeResolution,
	TEXT("Resolution of the probe's 2d radiance layout.  The number of rays traced for the probe will be ProbeResolution ^ 2"),
	ECVF_RenderThreadSafe
);

int32 GLumenIrradianceFieldProbeIrradianceResolution = 6;

#Associated Variable and Callsites

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

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

Scope: file

Source code excerpt:

);

int32 GLumenIrradianceFieldProbeResolution = 16;
FAutoConsoleVariableRef CVarLumenIrradianceFieldProbeResolution(
	TEXT("r.Lumen.IrradianceFieldGather.ProbeResolution"),
	GLumenIrradianceFieldProbeResolution,
	TEXT("Resolution of the probe's 2d radiance layout.  The number of rays traced for the probe will be ProbeResolution ^ 2"),
	ECVF_RenderThreadSafe
);

int32 GLumenIrradianceFieldProbeIrradianceResolution = 6;
FAutoConsoleVariableRef CVarLumenIrradianceFieldProbeIrradianceResolution(

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

Scope (from outer to inner):

file
namespace    LumenIrradianceFieldGather
function     LumenRadianceCache::FRadianceCacheInputs SetupRadianceCacheInputs

Source code excerpt:

		Parameters.ProbeAtlasResolutionInProbes = FIntPoint(GLumenIrradianceFieldProbeAtlasResolutionInProbes, GLumenIrradianceFieldProbeAtlasResolutionInProbes);
		Parameters.NumRadianceProbeClipmaps = FMath::Clamp(GLumenIrradianceFieldNumClipmaps, 1, LumenRadianceCache::MaxClipmaps);
		Parameters.RadianceProbeResolution = FMath::Max(GLumenIrradianceFieldProbeResolution, LumenRadianceCache::MinRadianceProbeResolution);
		Parameters.FinalProbeResolution = GLumenIrradianceFieldProbeResolution + 2 * (1 << (GLumenIrradianceFieldNumMipmaps - 1));
		Parameters.FinalRadianceAtlasMaxMip = GLumenIrradianceFieldNumMipmaps - 1;
		Parameters.CalculateIrradiance = 1;
		Parameters.IrradianceProbeResolution = GLumenIrradianceFieldProbeIrradianceResolution;
		Parameters.OcclusionProbeResolution = GLumenIrradianceFieldProbeOcclusionResolution;
		Parameters.NumProbesToTraceBudget = GLumenIrradianceFieldNumProbesToTraceBudget;
		Parameters.RadianceCacheStats = GLumenIrradianceFieldStats;