r.Streaming.NumStaticComponentsProcessedPerFrame
r.Streaming.NumStaticComponentsProcessedPerFrame
#Overview
name: r.Streaming.NumStaticComponentsProcessedPerFrame
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
If non-zero, the engine will incrementaly inserting levels by processing this amount of components per frame before they become visible
It is referenced in 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Streaming.NumStaticComponentsProcessedPerFrame is to control the incremental insertion of levels by limiting the number of static components processed per frame before they become visible. This setting is primarily used in the rendering system, specifically for texture streaming and level loading optimization.
The Unreal Engine subsystem that relies on this setting variable is the Streaming Manager, particularly the texture streaming component. This can be seen from the file locations where the variable is referenced, such as StreamingManagerTexture.cpp and TextureStreamingHelpers.cpp.
The value of this variable is set through a console variable (CVar) system. It’s defined with a default value of 50, but can be changed at runtime or through configuration files.
The associated variable CVarStreamingNumStaticComponentsProcessedPerFrame interacts directly with r.Streaming.NumStaticComponentsProcessedPerFrame. They share the same value and purpose.
Developers must be aware that:
- Setting this value to 0 disables incremental updates, allowing all components to be processed in a single frame.
- The value directly impacts the balance between level loading speed and frame rate stability.
Best practices when using this variable include:
- Adjust the value based on the complexity of your levels and target hardware capabilities.
- Monitor performance metrics to find the optimal balance between loading speed and frame rate.
- Consider increasing the value for more powerful hardware and decreasing it for less powerful systems.
Regarding the associated variable CVarStreamingNumStaticComponentsProcessedPerFrame:
- It’s used in the same context as r.Streaming.NumStaticComponentsProcessedPerFrame.
- It’s accessed in the FRenderAssetStreamingManager::IncrementalUpdate function to determine the number of steps left for incremental building.
- When its value is 0 or negative, it’s treated as if there’s no limit (MAX_int64 is used instead).
- Developers should be aware that this variable directly controls the incremental update behavior of the streaming system.
#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:224
Scope: file
Source code excerpt:
TAutoConsoleVariable<int32> CVarStreamingNumStaticComponentsProcessedPerFrame(
TEXT("r.Streaming.NumStaticComponentsProcessedPerFrame"),
50,
TEXT("If non-zero, the engine will incrementaly inserting levels by processing this amount of components per frame before they become visible"),
ECVF_Default);
TAutoConsoleVariable<int32> CVarStreamingDefragDynamicBounds(
TEXT("r.Streaming.DefragDynamicBounds"),
#Associated Variable and Callsites
This variable is associated with another variable named CVarStreamingNumStaticComponentsProcessedPerFrame
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Streaming/StreamingManagerTexture.cpp:413
Scope (from outer to inner):
file
function void FRenderAssetStreamingManager::IncrementalUpdate
Source code excerpt:
FRemovedRenderAssetArray RemovedRenderAssets;
int64 NumStepsLeftForIncrementalBuild = CVarStreamingNumStaticComponentsProcessedPerFrame.GetValueOnGameThread();
if (NumStepsLeftForIncrementalBuild <= 0) // When 0, don't allow incremental updates.
{
NumStepsLeftForIncrementalBuild = MAX_int64;
}
{
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Streaming/TextureStreamingHelpers.cpp:223
Scope: file
Source code excerpt:
ECVF_Default);
TAutoConsoleVariable<int32> CVarStreamingNumStaticComponentsProcessedPerFrame(
TEXT("r.Streaming.NumStaticComponentsProcessedPerFrame"),
50,
TEXT("If non-zero, the engine will incrementaly inserting levels by processing this amount of components per frame before they become visible"),
ECVF_Default);
TAutoConsoleVariable<int32> CVarStreamingDefragDynamicBounds(
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Streaming/TextureStreamingHelpers.h:63
Scope: file
Source code excerpt:
extern TAutoConsoleVariable<int32> CVarStreamingCheckBuildStatus;
extern TAutoConsoleVariable<int32> CVarStreamingUseMaterialData;
extern TAutoConsoleVariable<int32> CVarStreamingNumStaticComponentsProcessedPerFrame;
extern TAutoConsoleVariable<int32> CVarStreamingDefragDynamicBounds;
extern TAutoConsoleVariable<float> CVarStreamingMaxTextureUVDensity;
extern TAutoConsoleVariable<int32> CVarStreamingLowResHandlingMode;
struct FRenderAssetStreamingSettings
{