r.Lumen.Reflections.GGXSamplingBias
r.Lumen.Reflections.GGXSamplingBias
#Overview
name: r.Lumen.Reflections.GGXSamplingBias
This variable is created as a Console Variable (cvar).
- type:
Var
- help: ``
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Lumen.Reflections.GGXSamplingBias is to control the sampling bias for GGX (Generalized-Trowbridge-Reitz) distribution in Lumen reflections. This setting variable is part of Unreal Engine 5’s Lumen global illumination system, specifically for the reflection component.
This setting variable is primarily used in the Lumen Reflections subsystem within the Renderer module of Unreal Engine 5. It’s referenced in the LumenReflections.cpp file, which is responsible for handling the reflection calculations in the Lumen global illumination system.
The value of this variable is set through an FAutoConsoleVariableRef, which means it can be adjusted at runtime via console commands or through configuration files. The default value is set to 0.1f.
The associated variable GLumenReflectionGGXSamplingBias interacts directly with r.Lumen.Reflections.GGXSamplingBias. They share the same value, with GLumenReflectionGGXSamplingBias being the actual float variable used in the code.
Developers should be aware that this variable affects the quality and performance of reflections in Lumen. Adjusting this value can impact the appearance of reflections and potentially the performance of the reflection rendering process.
Best practices when using this variable include:
- Experimenting with different values to find the right balance between reflection quality and performance for your specific project.
- Be cautious when modifying this value, as it can affect the visual fidelity of reflections in your scene.
- Consider exposing this setting in your game’s graphics options to allow users to adjust it based on their hardware capabilities.
Regarding the associated variable GLumenReflectionGGXSamplingBias:
- Its purpose is to store the actual value used in the Lumen reflection calculations.
- It’s used directly in the RenderLumenReflections function of the FDeferredShadingSceneRenderer class.
- The value is passed to the shader parameters (PassParameters->GGXSamplingBias) for use in the reflection rendering process.
- Developers should be aware that modifying GLumenReflectionGGXSamplingBias directly in code will have the same effect as changing the r.Lumen.Reflections.GGXSamplingBias console variable.
- Best practice is to use the console variable (r.Lumen.Reflections.GGXSamplingBias) to modify this value rather than changing GLumenReflectionGGXSamplingBias directly in the code, as it provides more flexibility and allows for runtime adjustments.
#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:97
Scope: file
Source code excerpt:
float GLumenReflectionGGXSamplingBias = .1f;
FAutoConsoleVariableRef GVarLumenReflectionGGXSamplingBias(
TEXT("r.Lumen.Reflections.GGXSamplingBias"),
GLumenReflectionGGXSamplingBias,
TEXT(""),
ECVF_Scalability | ECVF_RenderThreadSafe
);
int32 GLumenReflectionTemporalFilter = 1;
#Associated Variable and Callsites
This variable is associated with another variable named GLumenReflectionGGXSamplingBias
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenReflections.cpp:95
Scope: file
Source code excerpt:
);
float GLumenReflectionGGXSamplingBias = .1f;
FAutoConsoleVariableRef GVarLumenReflectionGGXSamplingBias(
TEXT("r.Lumen.Reflections.GGXSamplingBias"),
GLumenReflectionGGXSamplingBias,
TEXT(""),
ECVF_Scalability | ECVF_RenderThreadSafe
);
int32 GLumenReflectionTemporalFilter = 1;
FAutoConsoleVariableRef CVarLumenReflectionTemporalFilter(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenReflections.cpp:1146
Scope (from outer to inner):
file
function FRDGTextureRef FDeferredShadingSceneRenderer::RenderLumenReflections
Source code excerpt:
PassParameters->MaxTraceDistance = Lumen::GetMaxTraceDistance(View);
PassParameters->RadianceCacheAngleThresholdScale = FMath::Clamp<float>(GLumenReflectionRadianceCacheAngleThresholdScale, .05f, 4.0f);
PassParameters->GGXSamplingBias = GLumenReflectionGGXSamplingBias;
PassParameters->SceneTexturesStruct = SceneTextures.UniformBuffer;
PassParameters->ResolveIndirectArgsForRead = GraphBuilder.CreateSRV(ReflectionTileParameters.TracingIndirectArgs, PF_R32_UINT);
if (FrontLayerReflectionGBuffer)
{
PassParameters->FrontLayerTranslucencyGBufferParameters = *FrontLayerReflectionGBuffer;
}