r.Lumen.Reflections.ScreenSpaceReconstruction.TonemapStrength
r.Lumen.Reflections.ScreenSpaceReconstruction.TonemapStrength
#Overview
name: r.Lumen.Reflections.ScreenSpaceReconstruction.TonemapStrength
The value of this variable can be defined or overridden in .ini config files. 3
.ini config files referencing this setting variable.
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Whether to tonemap reflection radiance values when they are averaged together during the spatial resolve. This reduces noise but also removes bright interesting features in reflections.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Lumen.Reflections.ScreenSpaceReconstruction.TonemapStrength is to control the tonemapping strength applied to reflection radiance values during the spatial resolve process in Lumen’s reflection system.
This setting variable is part of Unreal Engine 5’s Lumen global illumination system, specifically within the reflection rendering subsystem. It is used in the renderer module, as evidenced by its location in the LumenReflections.cpp file.
The value of this variable is set through the console variable system, using an FAutoConsoleVariableRef. It’s initialized with a default value of 0.0f and can be modified at runtime.
The associated variable GLumenReflectionSpatialResolveTonemapStrength directly interacts with this setting. They share the same value, as the console variable is bound to the GLumenReflectionSpatialResolveTonemapStrength variable.
Developers must be aware that this variable affects the balance between noise reduction and preservation of bright features in reflections. A higher value will reduce noise but may also remove interesting bright details in reflections.
Best practices when using this variable include:
- Fine-tuning the value to achieve the desired balance between noise reduction and visual fidelity.
- Testing the impact of different values in various lighting scenarios to ensure consistent quality across the game.
- Considering performance implications, as higher values may affect rendering performance.
Regarding the associated variable GLumenReflectionSpatialResolveTonemapStrength:
The purpose of GLumenReflectionSpatialResolveTonemapStrength is to store the actual value used by the rendering system for the tonemapping strength in Lumen’s reflection spatial resolve process.
This variable is used within the Lumen reflection rendering system, specifically in the RenderLumenReflections function of the FDeferredShadingSceneRenderer class.
The value of this variable is set by the console variable system through the r.Lumen.Reflections.ScreenSpaceReconstruction.TonemapStrength command.
It directly interacts with the PassParameters->SpatialResolveTonemapStrength in the reflection rendering pass.
Developers should be aware that modifying this variable directly in code is not recommended, as its value is controlled by the console variable system.
Best practices for this variable include:
- Accessing its value when needed in reflection-related calculations.
- Avoiding direct modification of the variable in code, instead using the console variable to change its value.
- Considering the impact of its value on the overall reflection quality and performance when designing lighting and reflection systems.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseScalability.ini:360, section: [ReflectionQuality@2]
- INI Section:
ReflectionQuality@2
- Raw value:
1
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseScalability.ini:370, section: [ReflectionQuality@3]
- INI Section:
ReflectionQuality@3
- Raw value:
0
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseScalability.ini:380, section: [ReflectionQuality@Cine]
- INI Section:
ReflectionQuality@Cine
- Raw value:
0
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenReflections.cpp:190
Scope: file
Source code excerpt:
float GLumenReflectionSpatialResolveTonemapStrength = 0.0f;
FAutoConsoleVariableRef CVarLumenReflectionSpatialResolveTonemapStrength(
TEXT("r.Lumen.Reflections.ScreenSpaceReconstruction.TonemapStrength"),
GLumenReflectionSpatialResolveTonemapStrength,
TEXT("Whether to tonemap reflection radiance values when they are averaged together during the spatial resolve. This reduces noise but also removes bright interesting features in reflections."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
int32 GLumenReflectionBilateralFilter = 1;
#Associated Variable and Callsites
This variable is associated with another variable named GLumenReflectionSpatialResolveTonemapStrength
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenReflections.cpp:188
Scope: file
Source code excerpt:
);
float GLumenReflectionSpatialResolveTonemapStrength = 0.0f;
FAutoConsoleVariableRef CVarLumenReflectionSpatialResolveTonemapStrength(
TEXT("r.Lumen.Reflections.ScreenSpaceReconstruction.TonemapStrength"),
GLumenReflectionSpatialResolveTonemapStrength,
TEXT("Whether to tonemap reflection radiance values when they are averaged together during the spatial resolve. This reduces noise but also removes bright interesting features in reflections."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
int32 GLumenReflectionBilateralFilter = 1;
FAutoConsoleVariableRef CVarLumenReflectionBilateralFilter(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenReflections.cpp:1246
Scope (from outer to inner):
file
function FRDGTextureRef FDeferredShadingSceneRenderer::RenderLumenReflections
Source code excerpt:
PassParameters->SpatialReconstructionKernelRadius = GLumenReflectionScreenSpaceReconstructionKernelRadius;
PassParameters->SpatialReconstructionRoughnessScale = GLumenReflectionScreenSpaceReconstructionRoughnessScale;
PassParameters->SpatialResolveTonemapStrength = GLumenReflectionSpatialResolveTonemapStrength;
PassParameters->ReflectionTracingParameters = ReflectionTracingParameters;
PassParameters->View = View.ViewUniformBuffer;
PassParameters->SceneTexturesStruct = SceneTextures.UniformBuffer;
if (FrontLayerReflectionGBuffer)
{