r.Lumen.IrradianceFieldGather.ProbeAtlasResolutionInProbes

r.Lumen.IrradianceFieldGather.ProbeAtlasResolutionInProbes

#Overview

name: r.Lumen.IrradianceFieldGather.ProbeAtlasResolutionInProbes

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.ProbeAtlasResolutionInProbes is to control the number of probes along one dimension of the probe atlas cache texture in Lumen’s Irradiance Field Gather system. This setting is part of Unreal Engine 5’s Lumen global illumination system, specifically for the irradiance field gathering process.

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

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

The associated variable GLumenIrradianceFieldProbeAtlasResolutionInProbes directly interacts with this console variable. They share the same value, with the console variable acting as an interface for runtime modification.

Developers must be aware that this variable controls the memory usage of the cache. The documentation explicitly states that overflow currently results in incorrect rendering. This means that setting this value too low could lead to visual artifacts or incorrect lighting in the scene.

Best practices when using this variable include:

  1. Carefully balancing between memory usage and rendering quality.
  2. Monitoring for any overflow situations that could lead to incorrect rendering.
  3. Testing different values to find the optimal setting for your specific scene and performance requirements.
  4. Being cautious when modifying this value at runtime, as it could have immediate impacts on rendering quality and performance.

Regarding the associated variable GLumenIrradianceFieldProbeAtlasResolutionInProbes:

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

Scope: file

Source code excerpt:

int32 GLumenIrradianceFieldProbeAtlasResolutionInProbes = 128;
FAutoConsoleVariableRef CVarLumenIrradianceFieldProbeAtlasResolutionInProbes(
	TEXT("r.Lumen.IrradianceFieldGather.ProbeAtlasResolutionInProbes"),
	GLumenIrradianceFieldProbeAtlasResolutionInProbes,
	TEXT("Number of probes along one dimension of the probe atlas cache texture.  This controls the memory usage of the cache.  Overflow currently results in incorrect rendering."),
	ECVF_RenderThreadSafe
);

float GLumenIrradianceFieldProbeOcclusionViewBias = 20;

#Associated Variable and Callsites

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

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

Scope: file

Source code excerpt:

);

int32 GLumenIrradianceFieldProbeAtlasResolutionInProbes = 128;
FAutoConsoleVariableRef CVarLumenIrradianceFieldProbeAtlasResolutionInProbes(
	TEXT("r.Lumen.IrradianceFieldGather.ProbeAtlasResolutionInProbes"),
	GLumenIrradianceFieldProbeAtlasResolutionInProbes,
	TEXT("Number of probes along one dimension of the probe atlas cache texture.  This controls the memory usage of the cache.  Overflow currently results in incorrect rendering."),
	ECVF_RenderThreadSafe
);

float GLumenIrradianceFieldProbeOcclusionViewBias = 20;
FAutoConsoleVariableRef CVarLumenIrradianceFieldProbeOcclusionViewBias(

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

Scope (from outer to inner):

file
namespace    LumenIrradianceFieldGather
function     LumenRadianceCache::FRadianceCacheInputs SetupRadianceCacheInputs

Source code excerpt:

		Parameters.ClipmapDistributionBase = GLumenIrradianceFieldClipmapDistributionBase;
		Parameters.RadianceProbeClipmapResolution = FMath::Clamp(GLumenIrradianceFieldGridResolution, 1, 256);
		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;