r.Streaming.UsePerTextureBias

r.Streaming.UsePerTextureBias

#Overview

name: r.Streaming.UsePerTextureBias

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

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of r.Streaming.UsePerTextureBias is to control the texture streaming system’s behavior in assigning mip bias to individual textures. Specifically, it determines whether each texture should be assigned a mip bias between 0 and MipBias as required to fit within the texture streaming budget.

This setting variable is primarily used by the texture streaming subsystem within Unreal Engine’s rendering module. It’s an important part of the engine’s texture streaming optimization system.

The value of this variable is set through a console variable (CVarStreamingUsePerTextureBias) in the Engine’s texture streaming helpers. It’s initialized with a default value of 1, meaning the feature is enabled by default.

The associated variable CVarStreamingUsePerTextureBias directly interacts with r.Streaming.UsePerTextureBias. They share the same value and purpose.

Developers should be aware that this variable significantly impacts how textures are streamed and rendered. When enabled (non-zero value), it allows for more granular control over texture quality, potentially improving performance and memory usage by allowing textures to be loaded at lower mip levels when under memory pressure.

Best practices when using this variable include:

  1. Keeping it enabled (default value of 1) for most scenarios, as it allows for better texture memory management.
  2. Monitoring its impact on texture quality and performance, especially in memory-constrained environments.
  3. Consider disabling it (set to 0) only if you need all textures to be loaded at their full resolution regardless of memory constraints.

Regarding the associated variable CVarStreamingUsePerTextureBias:

#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:181

Scope: file

Source code excerpt:


TAutoConsoleVariable<int32> CVarStreamingUsePerTextureBias(
	TEXT("r.Streaming.UsePerTextureBias"),
	1,
	TEXT("If non-zero, each texture will be assigned a mip bias between 0 and MipBias as required to fit in budget."),
	ECVF_Default);


TAutoConsoleVariable<int32> CVarStreamingFullyLoadUsedTextures(

#Associated Variable and Callsites

This variable is associated with another variable named CVarStreamingUsePerTextureBias. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Streaming/TextureStreamingHelpers.cpp:180

Scope: file

Source code excerpt:

	);

TAutoConsoleVariable<int32> CVarStreamingUsePerTextureBias(
	TEXT("r.Streaming.UsePerTextureBias"),
	1,
	TEXT("If non-zero, each texture will be assigned a mip bias between 0 and MipBias as required to fit in budget."),
	ECVF_Default);

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Streaming/TextureStreamingHelpers.cpp:313

Scope (from outer to inner):

file
function     void FRenderAssetStreamingSettings::Update

Source code excerpt:

	PoolSize = CVarStreamingPoolSize.GetValueOnAnyThread();
	MeshPoolSize = CVarStreamingPoolSizeForMeshes.GetValueOnAnyThread();
	bUsePerTextureBias = CVarStreamingUsePerTextureBias.GetValueOnAnyThread() != 0;
	bUseNewMetrics = CVarStreamingUseNewMetrics.GetValueOnAnyThread() != 0;
	bLimitPoolSizeToVRAM = !GIsEditor && CVarStreamingLimitPoolSizeToVRAM.GetValueOnAnyThread() != 0;
	bFullyLoadUsedTextures = CVarStreamingFullyLoadUsedTextures.GetValueOnAnyThread() != 0;
	bFullyLoadMeshes = CVarStreamingFullyLoadMeshes.GetValueOnAnyThread() != 0;
	bUseAllMips = CVarStreamingUseAllMips.GetValueOnAnyThread() != 0;
	MinMipForSplitRequest = CVarStreamingMinMipForSplitRequest.GetValueOnAnyThread();