r.ReflectionEnvironmentLightmapMixing
r.ReflectionEnvironmentLightmapMixing
#Overview
name: r.ReflectionEnvironmentLightmapMixing
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Whether to mix indirect specular from reflection captures with indirect diffuse from lightmaps for rough surfaces.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.ReflectionEnvironmentLightmapMixing is to control whether indirect specular reflections from reflection captures are mixed with indirect diffuse lighting from lightmaps for rough surfaces in the rendering system.
This setting variable is primarily used in the Renderer module of Unreal Engine, specifically in the reflection environment subsystem. It affects how the engine handles lighting and reflections for materials with varying degrees of roughness.
The value of this variable is set through the Unreal Engine console variable system. It is initialized with a default value of 1 (enabled) and can be changed at runtime using console commands or through project settings.
The associated variable GReflectionEnvironmentLightmapMixing directly interacts with r.ReflectionEnvironmentLightmapMixing. They share the same value and are used interchangeably in the code.
Developers should be aware that this variable affects the visual quality and performance of reflections in the scene. When enabled (set to 1), it provides more accurate lighting for rough surfaces by combining information from reflection captures and lightmaps. When disabled (set to 0), it may result in less realistic lighting for rough surfaces but could potentially improve performance.
Best practices when using this variable include:
- Testing the visual impact and performance implications of enabling or disabling this feature in your specific project.
- Considering the target hardware and performance requirements when deciding whether to enable this feature.
- Using this in conjunction with other reflection and lighting settings to achieve the desired visual quality and performance balance.
Regarding the associated variable GReflectionEnvironmentLightmapMixing:
- Its purpose is the same as r.ReflectionEnvironmentLightmapMixing, serving as an internal representation of the console variable.
- It is used directly in the C++ code to control the behavior of the reflection environment system.
- The value is set by the console variable system and can be accessed in C++ code where needed.
- Developers should treat this variable as read-only in most cases, relying on the console variable system to modify its value.
- Best practices include using this variable for conditional logic in rendering code related to reflection environment and lightmap mixing.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/ReflectionEnvironment.cpp:48
Scope: file
Source code excerpt:
int32 GReflectionEnvironmentLightmapMixing = 1;
FAutoConsoleVariableRef CVarReflectionEnvironmentLightmapMixing(
TEXT("r.ReflectionEnvironmentLightmapMixing"),
GReflectionEnvironmentLightmapMixing,
TEXT("Whether to mix indirect specular from reflection captures with indirect diffuse from lightmaps for rough surfaces."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
int32 GReflectionEnvironmentLightmapMixBasedOnRoughness = 1;
#Associated Variable and Callsites
This variable is associated with another variable named GReflectionEnvironmentLightmapMixing
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/ReflectionEnvironment.cpp:46
Scope: file
Source code excerpt:
ECVF_RenderThreadSafe | ECVF_Scalability);
int32 GReflectionEnvironmentLightmapMixing = 1;
FAutoConsoleVariableRef CVarReflectionEnvironmentLightmapMixing(
TEXT("r.ReflectionEnvironmentLightmapMixing"),
GReflectionEnvironmentLightmapMixing,
TEXT("Whether to mix indirect specular from reflection captures with indirect diffuse from lightmaps for rough surfaces."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
int32 GReflectionEnvironmentLightmapMixBasedOnRoughness = 1;
FAutoConsoleVariableRef CVarReflectionEnvironmentLightmapMixBasedOnRoughness(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/ReflectionEnvironment.cpp:115
Scope (from outer to inner):
file
function FVector GetReflectionEnvironmentRoughnessMixingScaleBiasAndLargestWeight
Source code excerpt:
float RoughnessMixingRange = 1.0f / FMath::Max(GReflectionEnvironmentEndMixingRoughness - GReflectionEnvironmentBeginMixingRoughness, .001f);
if (GReflectionEnvironmentLightmapMixing == 0)
{
return FVector(0, 0, GReflectionEnvironmentLightmapMixLargestWeight);
}
if (GReflectionEnvironmentEndMixingRoughness == 0.0f && GReflectionEnvironmentBeginMixingRoughness == 0.0f)
{