r.Streaming.MinBoost
r.Streaming.MinBoost
#Overview
name: r.Streaming.MinBoost
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Minimum clamp for r.Streaming.Boost
It is referenced in 5
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Streaming.MinBoost is to set a minimum clamp value for the texture streaming boost factor. It is primarily used in the texture streaming system of Unreal Engine 5.
This setting variable is utilized by the Engine’s content streaming subsystem, specifically within the texture streaming module. It’s referenced in the ContentStreaming.cpp and TextureStreamingHelpers.cpp files, which are part of the Engine’s runtime.
The value of this variable is set through the console variable system, allowing it to be adjusted dynamically during runtime. It’s defined with an initial value of 0.0f, but can be changed through console commands or configuration files.
The r.Streaming.MinBoost variable interacts closely with another variable called r.Streaming.Boost. It serves as a minimum threshold for the boost factor, ensuring that the final boost value used in texture streaming calculations is never below this minimum.
Developers should be aware that this variable affects the aggressiveness of texture streaming. A higher value will result in more aggressive streaming, potentially improving texture quality at the cost of increased memory usage and streaming activity.
Best practices when using this variable include:
- Carefully balancing it with r.Streaming.Boost to achieve desired streaming behavior.
- Testing different values to find the optimal setting for your specific game’s performance and visual quality requirements.
- Considering the target hardware capabilities when adjusting this value, as more aggressive streaming may impact performance on lower-end devices.
Regarding the associated variable CVarStreamingMinBoost:
The purpose of CVarStreamingMinBoost is to provide programmatic access to the r.Streaming.MinBoost console variable within the engine’s C++ code.
This variable is used in the Engine’s content streaming system, particularly in the AddViewInformation and AddViewLocation functions of the IStreamingManager class.
The value of CVarStreamingMinBoost is set by the console variable system and can be accessed in C++ code using the GetValueOnGameThread() method.
CVarStreamingMinBoost interacts directly with CVarStreamingBoost. It’s used to ensure that the final boost factor applied to texture streaming is never less than the minimum specified by r.Streaming.MinBoost.
Developers should be aware that changes to r.Streaming.MinBoost will be reflected in CVarStreamingMinBoost, and vice versa. This variable is crucial in determining the final boost factor used in texture streaming calculations.
Best practices when using CVarStreamingMinBoost include:
- Always comparing it with CVarStreamingBoost and using the maximum of the two values.
- Considering its impact on performance when modifying it, especially in performance-critical sections of code.
- Using it consistently across all relevant parts of the streaming system to ensure uniform behavior.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Streaming/TextureStreamingHelpers.cpp:76
Scope: file
Source code excerpt:
TAutoConsoleVariable<float> CVarStreamingMinBoost(
TEXT("r.Streaming.MinBoost"),
0.0f,
TEXT("Minimum clamp for r.Streaming.Boost"),
ECVF_Default
);
TAutoConsoleVariable<float> CVarStreamingScreenSizeEffectiveMax(
#Associated Variable and Callsites
This variable is associated with another variable named CVarStreamingMinBoost
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/ContentStreaming.cpp:636
Scope (from outer to inner):
file
function void IStreamingManager::AddViewInformation
Source code excerpt:
if ( FMath::Abs(ViewOrigin.X) < (1.0e+20f) && FMath::Abs(ViewOrigin.Y) < (1.0e+20f) && FMath::Abs(ViewOrigin.Z) < (1.0e+20f) )
{
const float MinBoost = CVarStreamingMinBoost.GetValueOnGameThread();
const float BoostScale = FMath::Max(CVarStreamingBoost.GetValueOnGameThread(),MinBoost);
BoostFactor *= BoostScale;
if ( bPendingRemoveViews )
{
bPendingRemoveViews = false;
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/ContentStreaming.cpp:681
Scope (from outer to inner):
file
function void IStreamingManager::AddViewLocation
Source code excerpt:
void IStreamingManager::AddViewLocation( const FVector& Location, float BoostFactor/*=1.0f*/, bool bOverrideLocation/*=false*/, float Duration/*=0.0f*/ )
{
const float MinBoost = CVarStreamingMinBoost.GetValueOnGameThread();
const float BoostScale = FMath::Max(CVarStreamingBoost.GetValueOnGameThread(),MinBoost);
BoostFactor *= BoostScale;
if ( bPendingRemoveViews )
{
bPendingRemoveViews = false;
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Streaming/TextureStreamingHelpers.cpp:75
Scope: file
Source code excerpt:
);
TAutoConsoleVariable<float> CVarStreamingMinBoost(
TEXT("r.Streaming.MinBoost"),
0.0f,
TEXT("Minimum clamp for r.Streaming.Boost"),
ECVF_Default
);
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Streaming/TextureStreamingHelpers.h:58
Scope: file
Source code excerpt:
extern TAutoConsoleVariable<float> CVarStreamingBoost;
extern TAutoConsoleVariable<float> CVarStreamingMinBoost;
extern TAutoConsoleVariable<int32> CVarStreamingUseFixedPoolSize;
extern TAutoConsoleVariable<int32> CVarStreamingPoolSize;
extern TAutoConsoleVariable<int32> CVarStreamingCheckBuildStatus;
extern TAutoConsoleVariable<int32> CVarStreamingUseMaterialData;
extern TAutoConsoleVariable<int32> CVarStreamingNumStaticComponentsProcessedPerFrame;
extern TAutoConsoleVariable<int32> CVarStreamingDefragDynamicBounds;