r.Streaming.MipCalculationEnablePerLevelList
r.Streaming.MipCalculationEnablePerLevelList
#Overview
name: r.Streaming.MipCalculationEnablePerLevelList
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
If non-zero, Mip size computation for streamed texture will use levels referenced with it (instead of iterating thorugh every levels).\n
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Streaming.MipCalculationEnablePerLevelList is to control the mip size computation strategy for streamed textures in Unreal Engine 5. Specifically, it determines whether the engine should use levels referenced with the texture or iterate through every level when calculating mip sizes.
This setting variable is primarily used by the texture streaming system, which is part of the rendering subsystem in Unreal Engine 5. Based on the callsites, it’s implemented in the Engine module, specifically within the texture streaming helpers.
The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of 1, meaning the feature is enabled by default. Developers can modify this value at runtime using console commands or through project settings.
The associated variable CVarStreamingMipCalculationEnablePerLevelList directly interacts with r.Streaming.MipCalculationEnablePerLevelList. They share the same value and purpose.
Developers should be aware that this variable can significantly impact the performance and memory usage of texture streaming. When enabled (non-zero value), it optimizes the mip size computation by considering only the levels referenced with the texture, potentially reducing unnecessary calculations.
Best practices for using this variable include:
- Leave it enabled (default value of 1) unless specific performance issues are observed.
- If disabling it, carefully monitor texture streaming performance and memory usage across different levels in the game.
- Consider adjusting this setting in conjunction with other texture streaming parameters for optimal results.
Regarding the associated variable CVarStreamingMipCalculationEnablePerLevelList:
This is the actual console variable that controls the behavior described above. It’s defined as a TAutoConsoleVariable
The variable is used in the FRenderAssetStreamingSettings::Update function to set the bMipCalculationEnablePerLevelList member, which likely controls the behavior of the texture streaming system.
Developers should note that changes to this CVar will take effect when the FRenderAssetStreamingSettings are updated, which typically happens periodically or when triggered by certain engine events.
When working with this variable, it’s important to understand its impact on the entire texture streaming pipeline and to test thoroughly across different scenarios and levels in the game to ensure optimal performance and visual quality.
#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:257
Scope: file
Source code excerpt:
TAutoConsoleVariable<int32> CVarStreamingMipCalculationEnablePerLevelList(
TEXT("r.Streaming.MipCalculationEnablePerLevelList"),
1,
TEXT("If non-zero, Mip size computation for streamed texture will use levels referenced with it (instead of iterating thorugh every levels).\n"),
ECVF_Default);
ENGINE_API TAutoConsoleVariable<int32> CVarFramesForFullUpdate(
TEXT("r.Streaming.FramesForFullUpdate"),
#Associated Variable and Callsites
This variable is associated with another variable named CVarStreamingMipCalculationEnablePerLevelList
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Streaming/TextureStreamingHelpers.cpp:256
Scope: file
Source code excerpt:
ECVF_Default);
TAutoConsoleVariable<int32> CVarStreamingMipCalculationEnablePerLevelList(
TEXT("r.Streaming.MipCalculationEnablePerLevelList"),
1,
TEXT("If non-zero, Mip size computation for streamed texture will use levels referenced with it (instead of iterating thorugh every levels).\n"),
ECVF_Default);
ENGINE_API TAutoConsoleVariable<int32> CVarFramesForFullUpdate(
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Streaming/TextureStreamingHelpers.cpp:327
Scope (from outer to inner):
file
function void FRenderAssetStreamingSettings::Update
Source code excerpt:
HiddenPrimitiveScale = bUseNewMetrics ? CVarStreamingHiddenPrimitiveScale.GetValueOnAnyThread() : 1.f;
LowResHandlingMode = (ELowResHandlingMode)CVarStreamingLowResHandlingMode.GetValueOnAnyThread();
bMipCalculationEnablePerLevelList = CVarStreamingMipCalculationEnablePerLevelList.GetValueOnAnyThread() != 0;
bPrioritizeMeshLODRetention = CVarPrioritizeMeshLODRetention.GetValueOnAnyThread() != 0;
VRAMPercentageClamp = CVarStreamingVRAMPercentageClamp.GetValueOnAnyThread();
MaterialQualityLevel = (int32)GetCachedScalabilityCVars().MaterialQualityLevel;
if (MinMipForSplitRequest <= 0)