r.SkylightIntensityMultiplier
r.SkylightIntensityMultiplier
#Overview
name: r.SkylightIntensityMultiplier
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Intensity scale on Stationary and Movable skylights. This is useful to control overall lighting contrast in dynamically lit games with scalability levels which disable Ambient Occlusion. For example, if medium quality disables SSAO and DFAO, reduce skylight intensity.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.SkylightIntensityMultiplier is to control the intensity scale of Stationary and Movable skylights in Unreal Engine 5. This setting variable is part of the lighting system, specifically affecting the skylight component.
The Unreal Engine rendering system, particularly the lighting module, relies on this setting variable. It is used within the SkyLightComponent.cpp file, which is part of the Engine’s runtime.
The value of this variable is set through the console variable system. It is initialized with a default value of 1.0f and can be modified at runtime using console commands or through scalability settings.
The r.SkylightIntensityMultiplier interacts directly with the associated variable GSkylightIntensityMultiplier. They share the same value, with r.SkylightIntensityMultiplier being the console-accessible name and GSkylightIntensityMultiplier being the actual global variable used in the code.
Developers must be aware that changing this variable will affect the overall lighting contrast in dynamically lit games. It’s particularly useful when working with different scalability levels that might disable certain lighting features like Ambient Occlusion.
Best practices when using this variable include:
- Adjusting it in conjunction with other lighting settings to maintain a balanced visual appearance.
- Using it to compensate for disabled Ambient Occlusion in lower quality settings.
- Being cautious about extreme values that might over or under-expose the scene.
Regarding the associated variable GSkylightIntensityMultiplier:
The purpose of GSkylightIntensityMultiplier is to store the actual value used in the engine’s calculations for skylight intensity.
It is used directly in the lighting calculations, specifically in the FSkyLightSceneProxy::GetEffectiveLightColor() function, where it multiplies the light color to adjust the skylight’s intensity.
The value of GSkylightIntensityMultiplier is set through the r.SkylightIntensityMultiplier console variable.
This variable interacts with the LightColor and SpecifiedCubemapColorScale in the final light color calculation for the skylight.
Developers should be aware that modifying GSkylightIntensityMultiplier directly in code is not recommended. Instead, they should use the r.SkylightIntensityMultiplier console variable to ensure proper synchronization.
The best practice is to treat GSkylightIntensityMultiplier as a read-only variable in most cases, relying on the console variable system for modifications.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Components/SkyLightComponent.cpp:79
Scope: file
Source code excerpt:
float GSkylightIntensityMultiplier = 1.0f;
FAutoConsoleVariableRef CVarSkylightIntensityMultiplier(
TEXT("r.SkylightIntensityMultiplier"),
GSkylightIntensityMultiplier,
TEXT("Intensity scale on Stationary and Movable skylights. This is useful to control overall lighting contrast in dynamically lit games with scalability levels which disable Ambient Occlusion. For example, if medium quality disables SSAO and DFAO, reduce skylight intensity."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
void OnChangeSkylightRealTimeReflectionCapture(IConsoleVariable* Var)
#Associated Variable and Callsites
This variable is associated with another variable named GSkylightIntensityMultiplier
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Components/SkyLightComponent.cpp:77
Scope: file
Source code excerpt:
);
float GSkylightIntensityMultiplier = 1.0f;
FAutoConsoleVariableRef CVarSkylightIntensityMultiplier(
TEXT("r.SkylightIntensityMultiplier"),
GSkylightIntensityMultiplier,
TEXT("Intensity scale on Stationary and Movable skylights. This is useful to control overall lighting contrast in dynamically lit games with scalability levels which disable Ambient Occlusion. For example, if medium quality disables SSAO and DFAO, reduce skylight intensity."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
void OnChangeSkylightRealTimeReflectionCapture(IConsoleVariable* Var)
{
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Components/SkyLightComponent.cpp:209
Scope (from outer to inner):
file
function FLinearColor FSkyLightSceneProxy::GetEffectiveLightColor
Source code excerpt:
FLinearColor FSkyLightSceneProxy::GetEffectiveLightColor() const
{
return LightColor * GSkylightIntensityMultiplier * SpecifiedCubemapColorScale;
}
FSkyLightSceneProxy::FSkyLightSceneProxy(const USkyLightComponent* InLightComponent)
: LightComponent(InLightComponent)
, ProcessedTexture(InLightComponent->ProcessedSkyTexture)
, SkyDistanceThreshold(InLightComponent->SkyDistanceThreshold)