r.Lumen.Reflections.MaxRayIntensity
r.Lumen.Reflections.MaxRayIntensity
#Overview
name: r.Lumen.Reflections.MaxRayIntensity
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Clamps the maximum ray lighting intensity (with PreExposure) to reduce fireflies.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Lumen.Reflections.MaxRayIntensity is to clamp the maximum ray lighting intensity in Lumen reflections to reduce fireflies (very bright, small artifacts) in the rendered image.
This setting variable is primarily used in the Lumen reflection system, which is part of Unreal Engine’s global illumination and reflection rendering pipeline. It’s specifically utilized in the Lumen Reflections module of the rendering subsystem.
The value of this variable is set through the console variable system, as indicated by the FAutoConsoleVariableRef declaration. It can be modified at runtime, allowing for dynamic adjustments to the reflection rendering.
The associated variable GLumenReflectionMaxRayIntensity directly interacts with r.Lumen.Reflections.MaxRayIntensity. They share the same value, with GLumenReflectionMaxRayIntensity being the C++ variable used in the actual rendering code.
Developers should be aware that this variable affects the visual quality of reflections. Setting it too low might reduce fireflies but could also diminish the intensity of legitimate bright reflections. Conversely, setting it too high might allow for more accurate bright reflections but could introduce more firefly artifacts.
Best practices when using this variable include:
- Fine-tuning the value based on the specific lighting conditions of your scene.
- Testing across various lighting scenarios to ensure a good balance between artifact reduction and reflection accuracy.
- Considering performance implications, as clamping ray intensity might affect the overall rendering performance.
Regarding GLumenReflectionMaxRayIntensity, it’s the internal C++ variable that directly controls the maximum ray intensity in the Lumen reflection calculations. It’s used in the FDeferredShadingSceneRenderer::RenderLumenReflections function to set the MaxRayIntensity parameter for reflection tracing. Developers working directly with the Unreal Engine source code should use this variable when implementing custom reflection rendering logic or modifying the existing Lumen reflection system.
#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:142
Scope: file
Source code excerpt:
float GLumenReflectionMaxRayIntensity = 100;
FAutoConsoleVariableRef GVarLumenReflectionMaxRayIntensity(
TEXT("r.Lumen.Reflections.MaxRayIntensity"),
GLumenReflectionMaxRayIntensity,
TEXT("Clamps the maximum ray lighting intensity (with PreExposure) to reduce fireflies."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
float GLumenReflectionSmoothBias = 0.0f;
#Associated Variable and Callsites
This variable is associated with another variable named GLumenReflectionMaxRayIntensity
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenReflections.cpp:140
Scope: file
Source code excerpt:
);
float GLumenReflectionMaxRayIntensity = 100;
FAutoConsoleVariableRef GVarLumenReflectionMaxRayIntensity(
TEXT("r.Lumen.Reflections.MaxRayIntensity"),
GLumenReflectionMaxRayIntensity,
TEXT("Clamps the maximum ray lighting intensity (with PreExposure) to reduce fireflies."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
float GLumenReflectionSmoothBias = 0.0f;
FAutoConsoleVariableRef GVarLumenReflectionSmoothBias(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenReflections.cpp:1092
Scope (from outer to inner):
file
function FRDGTextureRef FDeferredShadingSceneRenderer::RenderLumenReflections
Source code excerpt:
ReflectionTracingParameters.ReflectionTracingViewSize = ViewSize;
ReflectionTracingParameters.ReflectionTracingBufferSize = BufferSize;
ReflectionTracingParameters.MaxRayIntensity = GLumenReflectionMaxRayIntensity;
ReflectionTracingParameters.ReflectionSmoothBias = GLumenReflectionSmoothBias;
ReflectionTracingParameters.ReflectionPass = (uint32)ReflectionPass;
ReflectionTracingParameters.UseJitter = bDenoise && GLumenReflectionTemporalFilter ? 1 : 0;
ReflectionTracingParameters.UseHighResSurface = CVarLumenReflectionsHiResSurface.GetValueOnRenderThread() != 0 ? 1 : 0;
ReflectionTracingParameters.MaxReflectionBounces = LumenReflections::GetMaxReflectionBounces(View);
ReflectionTracingParameters.MaxRefractionBounces = LumenReflections::GetMaxRefractionBounces(View);