r.LumenScene.Radiosity.UpdateFactor
r.LumenScene.Radiosity.UpdateFactor
#Overview
name: r.LumenScene.Radiosity.UpdateFactor
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Controls for how many texels radiosity will be updated every frame. Texels = SurfaceCacheTexels / Factor.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.LumenScene.Radiosity.UpdateFactor is to control the rate at which radiosity is updated in the Lumen Scene lighting system. This setting variable is part of Unreal Engine 5’s rendering system, specifically the Lumen global illumination feature.
This setting variable is primarily used in the Lumen Scene Lighting module, which is part of Unreal Engine’s rendering subsystem. Based on the callsites, it’s clear that this variable is utilized in the LumenSceneLighting.cpp file, which is responsible for managing the Lumen scene lighting calculations.
The value of this variable is set through the Unreal Engine console variable system. It’s defined as an FAutoConsoleVariableRef, which means it can be adjusted at runtime through console commands or configuration files.
The associated variable GLumenRadiosityUpdateFactor interacts directly with r.LumenScene.Radiosity.UpdateFactor. They share the same value, with GLumenRadiosityUpdateFactor being the actual integer variable used in the C++ code.
Developers must be aware that this variable affects the performance and quality trade-off in the Lumen lighting system. A higher value means fewer texels are updated per frame, which can improve performance but may reduce the responsiveness of indirect lighting changes.
Best practices when using this variable include:
- Adjusting it based on the specific needs of your scene and target hardware.
- Testing different values to find the right balance between performance and lighting quality.
- Consider scaling this value dynamically based on the current performance of the game or application.
Regarding the associated variable GLumenRadiosityUpdateFactor:
This is an integer variable that directly controls the radiosity update factor in the Lumen scene lighting system. It’s used in the BuildCardUpdateContext function to determine the size of the indirect lighting update atlas. The variable is divided by a LumenSceneLightingUpdateSpeed factor, which suggests that the actual update rate can be further modified by other settings.
Developers should be aware that modifying GLumenRadiosityUpdateFactor directly in code will have the same effect as changing the r.LumenScene.Radiosity.UpdateFactor console variable. However, it’s generally recommended to use the console variable for easier runtime adjustments and configuration management.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenSceneLighting.cpp:38
Scope: file
Source code excerpt:
int32 GLumenRadiosityUpdateFactor = 64;
FAutoConsoleVariableRef CVarLumenSceneRadiosityUpdateFactor(
TEXT("r.LumenScene.Radiosity.UpdateFactor"),
GLumenRadiosityUpdateFactor,
TEXT("Controls for how many texels radiosity will be updated every frame. Texels = SurfaceCacheTexels / Factor."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
int32 GLumenLightingStats = 0;
#Associated Variable and Callsites
This variable is associated with another variable named GLumenRadiosityUpdateFactor
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenSceneLighting.cpp:36
Scope: file
Source code excerpt:
);
int32 GLumenRadiosityUpdateFactor = 64;
FAutoConsoleVariableRef CVarLumenSceneRadiosityUpdateFactor(
TEXT("r.LumenScene.Radiosity.UpdateFactor"),
GLumenRadiosityUpdateFactor,
TEXT("Controls for how many texels radiosity will be updated every frame. Texels = SurfaceCacheTexels / Factor."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
int32 GLumenLightingStats = 0;
FAutoConsoleVariableRef CVarLumenSceneLightingStats(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenSceneLighting.cpp:533
Scope (from outer to inner):
file
function void Lumen::BuildCardUpdateContext
Source code excerpt:
SetLightingUpdateAtlasSize(LumenSceneData.GetPhysicalAtlasSize(), FMath::RoundToInt(GLumenDirectLightingUpdateFactor / LumenSceneLightingUpdateSpeed), DirectLightingCardUpdateContext);
SetLightingUpdateAtlasSize(LumenSceneData.GetPhysicalAtlasSize(), FMath::RoundToInt(GLumenRadiosityUpdateFactor / LumenSceneLightingUpdateSpeed), IndirectLightingCardUpdateContext);
DirectLightingCardUpdateContext.CardPageIndexAllocator = GraphBuilder.CreateBuffer(FRDGBufferDesc::CreateStructuredDesc(sizeof(uint32), 1), TEXT("Lumen.DirectLightingCardPageIndexAllocator"));
DirectLightingCardUpdateContext.CardPageIndexData = GraphBuilder.CreateBuffer(FRDGBufferDesc::CreateStructuredDesc(sizeof(uint32), FMath::RoundUpToPowerOfTwo(NumCardPages)), TEXT("Lumen.DirectLightingCardPageIndexData"));
DirectLightingCardUpdateContext.DrawCardPageIndicesIndirectArgs = GraphBuilder.CreateBuffer(FRDGBufferDesc::CreateIndirectDesc<FRHIDrawIndirectParameters>(1), TEXT("Lumen.DirectLighting.DrawCardPageIndicesIndirectArgs"));
DirectLightingCardUpdateContext.DispatchCardPageIndicesIndirectArgs = GraphBuilder.CreateBuffer(FRDGBufferDesc::CreateIndirectDesc<FRHIDispatchIndirectParameters>(FLumenCardUpdateContext::MAX), TEXT("Lumen.DirectLighting.DispatchCardPageIndicesIndirectArgs"));