r.Streaming.UseAllMips
r.Streaming.UseAllMips
#Overview
name: r.Streaming.UseAllMips
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
If non-zero, all available mips will be used
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Streaming.UseAllMips is to control the texture streaming behavior in Unreal Engine 5’s rendering system. Specifically, it determines whether all available mip levels of textures should be used during streaming.
This setting variable is primarily used by the texture streaming subsystem within Unreal Engine’s rendering module. Based on the callsites, it’s evident that this variable is part of the texture streaming helpers and is used to configure the render asset streaming settings.
The value of this variable is set through a console variable (CVarStreamingUseAllMips) with a default value of 0. It can be changed at runtime using console commands or through project settings.
The associated variable CVarStreamingUseAllMips directly interacts with r.Streaming.UseAllMips. They share the same value and purpose. This console variable is used to get the current value of the setting in the engine’s code.
Developers must be aware that enabling this variable (setting it to a non-zero value) will cause the engine to use all available mip levels for textures. This can have significant performance and memory implications, as it may increase the amount of texture data loaded and processed by the GPU.
Best practices when using this variable include:
- Keep it disabled (0) by default for optimal performance and memory usage.
- Enable it only when necessary, such as for debugging texture streaming issues or in specific scenarios where you need to force the engine to use all mip levels.
- Be cautious when enabling this in production builds, as it can lead to increased memory usage and potential performance issues.
- Monitor performance and memory usage closely when this setting is enabled.
- Consider using it in conjunction with other texture streaming settings to fine-tune the streaming behavior for your specific project needs.
Regarding the associated variable CVarStreamingUseAllMips:
This is a TAutoConsoleVariable
When working with CVarStreamingUseAllMips, developers should:
- Use GetValueOnAnyThread() to safely retrieve the current value of the setting.
- Be aware that changes to this variable will immediately affect the texture streaming behavior.
- Consider exposing this setting in your project’s user interface if you want to allow runtime configuration of texture streaming behavior.
- Use this variable in conjunction with other streaming settings to create a comprehensive texture streaming strategy for your project.
#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:200
Scope: file
Source code excerpt:
TAutoConsoleVariable<int32> CVarStreamingUseAllMips(
TEXT("r.Streaming.UseAllMips"),
0,
TEXT("If non-zero, all available mips will be used"),
ECVF_Default);
TAutoConsoleVariable<int32> CVarStreamingLimitPoolSizeToVRAM(
TEXT("r.Streaming.LimitPoolSizeToVRAM"),
#Associated Variable and Callsites
This variable is associated with another variable named CVarStreamingUseAllMips
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Streaming/TextureStreamingHelpers.cpp:199
Scope: file
Source code excerpt:
ECVF_Default);
TAutoConsoleVariable<int32> CVarStreamingUseAllMips(
TEXT("r.Streaming.UseAllMips"),
0,
TEXT("If non-zero, all available mips will be used"),
ECVF_Default);
TAutoConsoleVariable<int32> CVarStreamingLimitPoolSizeToVRAM(
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Streaming/TextureStreamingHelpers.cpp:318
Scope (from outer to inner):
file
function void FRenderAssetStreamingSettings::Update
Source code excerpt:
bFullyLoadUsedTextures = CVarStreamingFullyLoadUsedTextures.GetValueOnAnyThread() != 0;
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;