r.Lumen.IrradianceFieldGather.NumProbesToTraceBudget

r.Lumen.IrradianceFieldGather.NumProbesToTraceBudget

#Overview

name: r.Lumen.IrradianceFieldGather.NumProbesToTraceBudget

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.NumProbesToTraceBudget is to control the number of probes that can be updated in a frame before downsampling in the Lumen Irradiance Field system. This setting is part of Unreal Engine 5’s Lumen global illumination system, specifically the Irradiance Field component.

This setting variable is primarily used in the Lumen subsystem of Unreal Engine’s rendering module. Based on the callsites, it’s clear that this variable is utilized in the LumenIrradianceFieldGather.cpp file, which is part of the Renderer’s private implementation.

The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of 200 and can be modified at runtime using the console command system.

The associated variable GLumenIrradianceFieldNumProbesToTraceBudget directly interacts with this setting. They share the same value, with GLumenIrradianceFieldNumProbesToTraceBudget being the actual variable used in the C++ code to control the behavior.

Developers should be aware that this variable affects performance and quality trade-offs in the Lumen system. A higher number of probes to trace per frame can provide more accurate lighting updates but may impact performance. Conversely, a lower number might improve performance but could result in less responsive or less accurate global illumination.

Best practices when using this variable include:

  1. Adjusting it based on the specific needs of your scene and target hardware.
  2. Monitoring performance impacts when modifying this value.
  3. Considering the balance between lighting update frequency and overall performance.
  4. Testing different values to find the optimal setting for your specific use case.

Regarding the associated variable GLumenIrradianceFieldNumProbesToTraceBudget:

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

Scope: file

Source code excerpt:

int32 GLumenIrradianceFieldNumProbesToTraceBudget = 200;
FAutoConsoleVariableRef CVarLumenIrradianceFieldNumProbesToTraceBudget(
	TEXT("r.Lumen.IrradianceFieldGather.NumProbesToTraceBudget"),
	GLumenIrradianceFieldNumProbesToTraceBudget,
	TEXT("Number of probes that can be updated in a frame before downsampling."),
	ECVF_RenderThreadSafe
);

int32 GLumenIrradianceFieldGridResolution = 64;

#Associated Variable and Callsites

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

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

Scope: file

Source code excerpt:

);

int32 GLumenIrradianceFieldNumProbesToTraceBudget = 200;
FAutoConsoleVariableRef CVarLumenIrradianceFieldNumProbesToTraceBudget(
	TEXT("r.Lumen.IrradianceFieldGather.NumProbesToTraceBudget"),
	GLumenIrradianceFieldNumProbesToTraceBudget,
	TEXT("Number of probes that can be updated in a frame before downsampling."),
	ECVF_RenderThreadSafe
);

int32 GLumenIrradianceFieldGridResolution = 64;
FAutoConsoleVariableRef CVarLumenIrradianceFieldResolution(

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

Scope (from outer to inner):

file
namespace    LumenIrradianceFieldGather
function     LumenRadianceCache::FRadianceCacheInputs SetupRadianceCacheInputs

Source code excerpt:

		Parameters.IrradianceProbeResolution = GLumenIrradianceFieldProbeIrradianceResolution;
		Parameters.OcclusionProbeResolution = GLumenIrradianceFieldProbeOcclusionResolution;
		Parameters.NumProbesToTraceBudget = GLumenIrradianceFieldNumProbesToTraceBudget;
		Parameters.RadianceCacheStats = GLumenIrradianceFieldStats;
		return Parameters;
	}
}

class FMarkRadianceProbesUsedByGBufferCS : public FGlobalShader