r.Bloom.ApplyLocalExposure
r.Bloom.ApplyLocalExposure
#Overview
name: r.Bloom.ApplyLocalExposure
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Whether to apply local exposure when calculating bloom, default: true
It is referenced in 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Bloom.ApplyLocalExposure is to control whether local exposure is applied when calculating bloom in Unreal Engine’s rendering pipeline. Here’s a breakdown of its usage and implications:
-
Purpose: This setting variable is part of the rendering system, specifically the bloom post-processing effect.
-
Subsystem reliance: The bloom and local exposure features of Unreal Engine’s post-processing system rely on this variable.
-
Value setting: The value is set as a console variable (CVar) with a default value of true. It can be changed at runtime.
-
Interaction with other variables: It interacts with LocalExposureTexture. When r.Bloom.ApplyLocalExposure is true, the LocalExposureTexture is used in bloom calculations.
-
Developer awareness: Developers should be aware that this variable affects the visual quality and performance of the bloom effect. Enabling it can provide more accurate bloom in scenes with varying exposure levels, but may have a slight performance cost.
-
Best practices:
- Use this variable to fine-tune the bloom effect in scenes with complex lighting.
- Consider disabling it if performance is a concern and the visual difference is negligible.
- Test your scenes with this variable both enabled and disabled to determine the best setting for your project.
The associated variable CVarBloomApplyLocalExposure is directly linked to r.Bloom.ApplyLocalExposure. It’s used in the C++ code to retrieve the current value of the console variable. This variable is used in conditional statements to determine whether to apply local exposure in bloom-related calculations.
For example, in the bloom setup pass:
SetupPassInputs.LocalExposureTexture = CVarBloomApplyLocalExposure.GetValueOnRenderThread() ? LocalExposureTexture : nullptr;
This code sets the LocalExposureTexture input for the bloom setup pass only if CVarBloomApplyLocalExposure is true. If it’s false, nullptr is passed instead, effectively disabling local exposure for bloom calculations.
Developers should use this variable in conjunction with other bloom and exposure settings to achieve the desired visual quality while balancing performance requirements.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessing.cpp:96
Scope (from outer to inner):
file
namespace anonymous
Source code excerpt:
TAutoConsoleVariable<bool> CVarBloomApplyLocalExposure(
TEXT("r.Bloom.ApplyLocalExposure"),
true,
TEXT("Whether to apply local exposure when calculating bloom, default: true"),
ECVF_Scalability | ECVF_RenderThreadSafe);
TAutoConsoleVariable<int32> CVarPostProcessingPropagateAlpha(
TEXT("r.PostProcessing.PropagateAlpha"),
#Associated Variable and Callsites
This variable is associated with another variable named CVarBloomApplyLocalExposure
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessing.cpp:95
Scope (from outer to inner):
file
namespace anonymous
Source code excerpt:
ECVF_Scalability | ECVF_RenderThreadSafe);
TAutoConsoleVariable<bool> CVarBloomApplyLocalExposure(
TEXT("r.Bloom.ApplyLocalExposure"),
true,
TEXT("Whether to apply local exposure when calculating bloom, default: true"),
ECVF_Scalability | ECVF_RenderThreadSafe);
TAutoConsoleVariable<int32> CVarPostProcessingPropagateAlpha(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessing.cpp:1161
Scope (from outer to inner):
file
function void AddPostProcessingPasses
Source code excerpt:
EyeAdaptationBuffer,
LocalExposureParameters,
CVarBloomApplyLocalExposure.GetValueOnRenderThread() ? LocalExposureTexture : nullptr,
LocalExposureBlurredLogLumTexture);
Bloom = Outputs.BloomTexture;
SceneColorApplyParameters = Outputs.SceneColorApplyParameters;
}
else
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessing.cpp:1189
Scope (from outer to inner):
file
function void AddPostProcessingPasses
Source code excerpt:
SetupPassInputs.EyeAdaptationParameters = &EyeAdaptationParameters;
SetupPassInputs.LocalExposureParameters = &LocalExposureParameters;
SetupPassInputs.LocalExposureTexture = CVarBloomApplyLocalExposure.GetValueOnRenderThread() ? LocalExposureTexture : nullptr;
SetupPassInputs.BlurredLogLuminanceTexture = LocalExposureBlurredLogLumTexture;
SetupPassInputs.Threshold = BloomThreshold;
DownsampleInput = FScreenPassTextureSlice::CreateFromScreenPassTexture(GraphBuilder, AddBloomSetupPass(GraphBuilder, View, SetupPassInputs));
}