r.Streaming.NumStaticComponentsProcessedPerFrame

r.Streaming.NumStaticComponentsProcessedPerFrame

#Overview

name: r.Streaming.NumStaticComponentsProcessedPerFrame

This variable is created as a Console Variable (cvar).

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:

  1. Setting this value to 0 disables incremental updates, allowing all components to be processed in a single frame.
  2. The value directly impacts the balance between level loading speed and frame rate stability.

Best practices when using this variable include:

  1. Adjust the value based on the complexity of your levels and target hardware capabilities.
  2. Monitor performance metrics to find the optimal balance between loading speed and frame rate.
  3. Consider increasing the value for more powerful hardware and decreasing it for less powerful systems.

Regarding the associated variable CVarStreamingNumStaticComponentsProcessedPerFrame:

#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
{