r.Streaming.MinMipForSplitRequest
r.Streaming.MinMipForSplitRequest
#Overview
name: r.Streaming.MinMipForSplitRequest
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
If non-zero, the minimum hidden mip for which load requests will first load the visible mip
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Streaming.MinMipForSplitRequest is to control the texture streaming behavior in Unreal Engine 5, specifically for determining when to split texture load requests.
This setting variable is primarily used by the texture streaming system, which is part of the engine’s rendering subsystem. It’s implemented in the Engine module, particularly within the texture streaming helpers.
The value of this variable is set through a console variable (CVar) named CVarStreamingMinMipForSplitRequest. It’s initialized with a default value of 10, which corresponds to a texture size of 512x512 pixels.
The variable interacts with the texture streaming system to determine when to split texture load requests. Specifically, it sets the minimum mip level (texture resolution) at which the engine will first load the visible mip level before loading the hidden mip levels.
Developers should be aware that this variable affects the performance and memory usage of texture streaming. A lower value will result in more split requests, potentially improving visible texture quality at the cost of increased loading operations. A higher value will reduce the number of split requests, which might be more efficient but could result in lower initial texture quality.
Best practices when using this variable include:
- Adjust it based on your game’s specific needs and target hardware capabilities.
- Monitor its impact on texture streaming performance and memory usage.
- Consider the trade-off between initial texture quality and loading efficiency.
Regarding the associated variable CVarStreamingMinMipForSplitRequest:
This is the actual console variable that stores and provides access to the r.Streaming.MinMipForSplitRequest setting. It’s defined as a TAutoConsoleVariable
The purpose of CVarStreamingMinMipForSplitRequest is to provide a programmable interface for the r.Streaming.MinMipForSplitRequest setting. It allows the engine and potentially other systems to read and modify the value of this setting programmatically.
This variable is used within the FRenderAssetStreamingSettings::Update() function to update the MinMipForSplitRequest member of the FRenderAssetStreamingSettings struct. This suggests that the texture streaming system periodically updates its settings based on the current value of this console variable.
Developers should be aware that changes to this console variable will affect the texture streaming behavior at runtime. It’s important to ensure that any code or systems that modify this variable do so in a thread-safe manner, as indicated by the use of GetValueOnAnyThread() in the update function.
Best practices for using CVarStreamingMinMipForSplitRequest include:
- Use it for dynamic adjustments of the texture streaming behavior, such as adapting to different performance scenarios.
- Consider exposing it as a user-configurable setting if fine-tuning texture streaming is important for your game.
- Be cautious when modifying it frequently, as it could impact performance and memory usage.
#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:237
Scope: file
Source code excerpt:
// Don't split small mips as the overhead of 2 load is significant.
TAutoConsoleVariable<int32> CVarStreamingMinMipForSplitRequest(
TEXT("r.Streaming.MinMipForSplitRequest"),
10, // => 512
TEXT("If non-zero, the minimum hidden mip for which load requests will first load the visible mip"),
ECVF_Default);
TAutoConsoleVariable<float> CVarStreamingMinLevelRenderAssetScreenSize(
TEXT("r.Streaming.MinLevelRenderAssetScreenSize"),
#Associated Variable and Callsites
This variable is associated with another variable named CVarStreamingMinMipForSplitRequest
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Streaming/TextureStreamingHelpers.cpp:236
Scope: file
Source code excerpt:
// Don't split small mips as the overhead of 2 load is significant.
TAutoConsoleVariable<int32> CVarStreamingMinMipForSplitRequest(
TEXT("r.Streaming.MinMipForSplitRequest"),
10, // => 512
TEXT("If non-zero, the minimum hidden mip for which load requests will first load the visible mip"),
ECVF_Default);
TAutoConsoleVariable<float> CVarStreamingMinLevelRenderAssetScreenSize(
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Streaming/TextureStreamingHelpers.cpp:319
Scope (from outer to inner):
file
function void FRenderAssetStreamingSettings::Update
Source code excerpt:
bFullyLoadMeshes = CVarStreamingFullyLoadMeshes.GetValueOnAnyThread() != 0;
bUseAllMips = CVarStreamingUseAllMips.GetValueOnAnyThread() != 0;
MinMipForSplitRequest = CVarStreamingMinMipForSplitRequest.GetValueOnAnyThread();
PerTextureBiasViewBoostThreshold = CVarStreamingPerTextureBiasViewBoostThreshold.GetValueOnAnyThread();
MaxHiddenPrimitiveViewBoost = FMath::Max<float>(1.f, CVarStreamingMaxHiddenPrimitiveViewBoost.GetValueOnAnyThread());
MinLevelRenderAssetScreenSize = CVarStreamingMinLevelRenderAssetScreenSize.GetValueOnAnyThread();
MaxTextureUVDensity = CVarStreamingMaxTextureUVDensity.GetValueOnAnyThread();
bUseMaterialData = bUseNewMetrics && CVarStreamingUseMaterialData.GetValueOnAnyThread() != 0;
HiddenPrimitiveScale = bUseNewMetrics ? CVarStreamingHiddenPrimitiveScale.GetValueOnAnyThread() : 1.f;