r.Lumen.IrradianceFieldGather.GridResolution
r.Lumen.IrradianceFieldGather.GridResolution
#Overview
name: r.Lumen.IrradianceFieldGather.GridResolution
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Resolution of the probe placement grid within each clipmap
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Lumen.IrradianceFieldGather.GridResolution is to control the resolution of the probe placement grid within each clipmap in Unreal Engine 5’s Lumen global illumination system. This setting variable is part of the rendering system, specifically the Lumen irradiance field gathering process.
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 suggests it’s crucial for the irradiance field gathering process in Lumen.
The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of 64 and can be changed at runtime through console commands or project settings.
The variable interacts directly with GLumenIrradianceFieldGridResolution, which is the internal C++ variable that stores the actual value. It’s used in conjunction with other Lumen-related variables to set up the radiance cache inputs for the irradiance field.
Developers should be aware that this variable affects the density of probes in the irradiance field. A higher value will result in a denser grid of probes, potentially increasing accuracy but also increasing computational cost.
Best practices when using this variable include:
- Balancing between quality and performance. Higher resolutions provide better lighting quality but at the cost of performance.
- Adjusting it in conjunction with other Lumen settings for optimal results.
- Testing different values to find the best balance for your specific scene and performance targets.
Regarding the associated variable GLumenIrradianceFieldGridResolution:
This is the internal C++ variable that directly stores the value set by r.Lumen.IrradianceFieldGather.GridResolution. It’s used in the SetupRadianceCacheInputs function to set the RadianceProbeClipmapResolution parameter. The value is clamped between 1 and 256 to ensure it stays within a reasonable range.
Developers should note that changes to r.Lumen.IrradianceFieldGather.GridResolution will directly affect GLumenIrradianceFieldGridResolution. This variable is used in performance-critical rendering code, so changes to it can have immediate effects on both visual quality and performance.
Best practices for GLumenIrradianceFieldGridResolution include:
- Avoid directly modifying this variable in code; instead, use the CVar system to change r.Lumen.IrradianceFieldGather.GridResolution.
- Be aware of its impact on performance when setting up rendering parameters.
- Consider its interaction with other Lumen parameters for optimal rendering results.
#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:55
Scope: file
Source code excerpt:
int32 GLumenIrradianceFieldGridResolution = 64;
FAutoConsoleVariableRef CVarLumenIrradianceFieldResolution(
TEXT("r.Lumen.IrradianceFieldGather.GridResolution"),
GLumenIrradianceFieldGridResolution,
TEXT("Resolution of the probe placement grid within each clipmap"),
ECVF_RenderThreadSafe
);
int32 GLumenIrradianceFieldProbeResolution = 16;
#Associated Variable and Callsites
This variable is associated with another variable named GLumenIrradianceFieldGridResolution
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenIrradianceFieldGather.cpp:53
Scope: file
Source code excerpt:
);
int32 GLumenIrradianceFieldGridResolution = 64;
FAutoConsoleVariableRef CVarLumenIrradianceFieldResolution(
TEXT("r.Lumen.IrradianceFieldGather.GridResolution"),
GLumenIrradianceFieldGridResolution,
TEXT("Resolution of the probe placement grid within each clipmap"),
ECVF_RenderThreadSafe
);
int32 GLumenIrradianceFieldProbeResolution = 16;
FAutoConsoleVariableRef CVarLumenIrradianceFieldProbeResolution(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenIrradianceFieldGather.cpp:133
Scope (from outer to inner):
file
namespace LumenIrradianceFieldGather
function LumenRadianceCache::FRadianceCacheInputs SetupRadianceCacheInputs
Source code excerpt:
Parameters.ClipmapWorldExtent = GLumenIrradianceFieldClipmapWorldExtent;
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;