r.Lumen.IrradianceFieldGather.ProbeAtlasResolutionInProbes
r.Lumen.IrradianceFieldGather.ProbeAtlasResolutionInProbes
#Overview
name: r.Lumen.IrradianceFieldGather.ProbeAtlasResolutionInProbes
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
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.
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:
- Carefully balancing between memory usage and rendering quality.
- Monitoring for any overflow situations that could lead to incorrect rendering.
- Testing different values to find the optimal setting for your specific scene and performance requirements.
- Being cautious when modifying this value at runtime, as it could have immediate impacts on rendering quality and performance.
Regarding the associated variable GLumenIrradianceFieldProbeAtlasResolutionInProbes:
- Its purpose is to store the actual value used by the rendering code.
- It’s used in the Lumen Irradiance Field Gather system to set up radiance cache inputs.
- The value is set by the console variable system and used directly in the rendering code.
- It interacts with other variables related to the Lumen Irradiance Field system, such as GLumenIrradianceFieldGridResolution and GLumenIrradianceFieldNumClipmaps.
- Developers should be aware that this variable directly affects the ProbeAtlasResolutionInProbes parameter in the radiance cache inputs.
- Best practices include ensuring that any code using this variable can handle potential runtime changes to its value.
#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;