r.DefaultFeature.Bloom
r.DefaultFeature.Bloom
#Overview
name: r.DefaultFeature.Bloom
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Engine default (project setting) for Bloom is (postprocess volume/camera/game setting still can override)\n 0: off, set BloomIntensity to 0\n 1: on (default)
It is referenced in 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.DefaultFeature.Bloom is to control the default setting for the Bloom post-processing effect in Unreal Engine 5. It is primarily used in the rendering system to determine whether Bloom should be enabled by default in the project.
This setting variable is primarily relied upon by the Engine module, specifically within the rendering and post-processing subsystems. It is used in the Scene and SceneView components of the engine.
The value of this variable is set through a console variable (CVarDefaultBloom) in the engine’s initialization code. It defaults to 1, meaning Bloom is enabled by default.
The associated variable CVarDefaultBloom interacts directly with r.DefaultFeature.Bloom. They share the same value and purpose.
Developers must be aware that this variable sets the engine default for Bloom, but it can be overridden by post-process volumes, camera settings, or game-specific settings. It’s important to note that setting this to 0 will set the BloomIntensity to 0, effectively turning off Bloom by default.
Best practices when using this variable include:
- Use it to set a project-wide default for Bloom.
- Remember that it can be overridden in specific areas of your game if needed.
- Consider performance implications when enabling or disabling Bloom by default.
- Use in conjunction with other post-processing settings for a cohesive visual style.
Regarding the associated variable CVarDefaultBloom:
The purpose of CVarDefaultBloom is to provide a console-accessible way to control the r.DefaultFeature.Bloom setting. It serves as the actual implementation of the r.DefaultFeature.Bloom console variable.
This variable is used in the Engine module, specifically within the SceneView component. It’s primarily used in the post-processing pipeline.
The value of CVarDefaultBloom is set during engine initialization and can be changed at runtime through the console.
CVarDefaultBloom directly interacts with the BloomIntensity setting in the post-processing settings. When CVarDefaultBloom is set to 0, it forces BloomIntensity to 0, effectively disabling Bloom.
Developers should be aware that changes to CVarDefaultBloom will affect the entire project unless overridden in specific scenarios. It’s a powerful tool for quickly adjusting the default Bloom behavior across the entire game.
Best practices for using CVarDefaultBloom include:
- Use it for debugging or quick project-wide changes to Bloom behavior.
- Remember that it affects the default setting, which can still be overridden in specific scenarios.
- Consider exposing it in development builds for easy tweaking, but possibly locking it down in shipping builds for consistency.
- Document its usage clearly for the development team to understand its project-wide impact.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/SceneView.cpp:136
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarDefaultBloom(
TEXT("r.DefaultFeature.Bloom"),
1,
TEXT("Engine default (project setting) for Bloom is (postprocess volume/camera/game setting still can override)\n")
TEXT(" 0: off, set BloomIntensity to 0\n")
TEXT(" 1: on (default)"));
static TAutoConsoleVariable<int32> CVarDefaultAmbientOcclusion(
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Scene.cpp:441
Scope (from outer to inner):
file
function FPostProcessSettings::FPostProcessSettings
Source code excerpt:
SceneFringeIntensity = 0.0f;
BloomMethod = BM_SOG;
// next value might get overwritten by r.DefaultFeature.Bloom
BloomIntensity = 0.675f;
BloomThreshold = -1.0f;
// default is 4 to maintain old settings after fixing something that caused a factor of 4
BloomSizeScale = 4.0;
Bloom1Tint = FLinearColor(0.3465f, 0.3465f, 0.3465f);
Bloom1Size = 0.3f;
#Associated Variable and Callsites
This variable is associated with another variable named CVarDefaultBloom
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/SceneView.cpp:135
Scope: file
Source code excerpt:
// Engine default (project settings):
static TAutoConsoleVariable<int32> CVarDefaultBloom(
TEXT("r.DefaultFeature.Bloom"),
1,
TEXT("Engine default (project setting) for Bloom is (postprocess volume/camera/game setting still can override)\n")
TEXT(" 0: off, set BloomIntensity to 0\n")
TEXT(" 1: on (default)"));
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/SceneView.cpp:1940
Scope (from outer to inner):
file
function void FSceneView::StartFinalPostprocessSettings
Source code excerpt:
// project settings might want to have different defaults
{
if(!CVarDefaultBloom.GetValueOnGameThread())
{
FinalPostProcessSettings.BloomIntensity = 0;
}
if (!CVarDefaultAmbientOcclusion.GetValueOnGameThread())
{
FinalPostProcessSettings.AmbientOcclusionIntensity = 0;