r.Lumen.Reflections.SmoothBias
r.Lumen.Reflections.SmoothBias
#Overview
name: r.Lumen.Reflections.SmoothBias
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Values larger than 0 apply a global material roughness bias for Lumen Reflections, where 1 is fully mirror.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Lumen.Reflections.SmoothBias is to apply a global material roughness bias for Lumen Reflections. It allows developers to adjust the smoothness of reflections across all materials in the scene.
This setting variable is primarily used in the Lumen Reflections system, which is part of Unreal Engine’s global illumination and reflection solution. It’s specifically utilized in the rendering subsystem, particularly in the Lumen reflections module.
The value of this variable is set through the console variable system, as indicated by the FAutoConsoleVariableRef declaration. This allows for runtime adjustment of the value, which can be useful for performance tuning and visual tweaking.
The associated variable GLumenReflectionSmoothBias interacts directly with r.Lumen.Reflections.SmoothBias. They share the same value, with GLumenReflectionSmoothBias being the C++ variable used in the rendering code to apply the bias.
Developers should be aware that increasing this value will make all reflections appear smoother or more mirror-like, regardless of the actual material properties. A value of 1 will make all reflections perfectly mirror-like.
Best practices when using this variable include:
- Use it sparingly, as it overrides material-specific roughness values.
- Consider it for performance optimization if detailed reflections are too costly.
- Adjust it in small increments, as large values can lead to unrealistic results.
- Remember that it affects all reflections globally, so it may not be suitable for fine-tuning specific areas or materials.
Regarding GLumenReflectionSmoothBias: This is the C++ variable that directly applies the smooth bias in the reflection calculations. It’s used in the FRenderLumenReflections function to set the ReflectionSmoothBias parameter for the reflection tracing process. Developers working directly with the C++ code should use this variable when they need to apply the smooth bias in custom rendering logic related to Lumen reflections.
#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:150
Scope: file
Source code excerpt:
float GLumenReflectionSmoothBias = 0.0f;
FAutoConsoleVariableRef GVarLumenReflectionSmoothBias(
TEXT("r.Lumen.Reflections.SmoothBias"),
GLumenReflectionSmoothBias,
TEXT("Values larger than 0 apply a global material roughness bias for Lumen Reflections, where 1 is fully mirror."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
int32 GLumenReflectionScreenSpaceReconstruction = 1;
#Associated Variable and Callsites
This variable is associated with another variable named GLumenReflectionSmoothBias
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenReflections.cpp:148
Scope: file
Source code excerpt:
);
float GLumenReflectionSmoothBias = 0.0f;
FAutoConsoleVariableRef GVarLumenReflectionSmoothBias(
TEXT("r.Lumen.Reflections.SmoothBias"),
GLumenReflectionSmoothBias,
TEXT("Values larger than 0 apply a global material roughness bias for Lumen Reflections, where 1 is fully mirror."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
int32 GLumenReflectionScreenSpaceReconstruction = 1;
FAutoConsoleVariableRef CVarLumenReflectionScreenSpaceReconstruction(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenReflections.cpp:1093
Scope (from outer to inner):
file
function FRDGTextureRef FDeferredShadingSceneRenderer::RenderLumenReflections
Source code excerpt:
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);
ReflectionTracingParameters.NearFieldMaxTraceDistance = NearFieldMaxTraceDistance;