r.Streaming.PerTextureBiasViewBoostThreshold

r.Streaming.PerTextureBiasViewBoostThreshold

#Overview

name: r.Streaming.PerTextureBiasViewBoostThreshold

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.PerTextureBiasViewBoostThreshold is to control the maximum view boost threshold for increasing per-texture bias in the texture streaming system. It helps prevent temporary small field of view (FOV) changes from permanently downgrading texture quality.

This setting variable is primarily used in the texture streaming subsystem of Unreal Engine’s rendering module. It is specifically utilized in the Engine’s runtime, as evident from its location in the Engine/Source/Runtime/Engine/Private/Streaming/TextureStreamingHelpers.cpp file.

The value of this variable is set using a TAutoConsoleVariable, which allows it to be modified at runtime through console commands. The default value is set to 1.5.

The variable interacts closely with the texture streaming system, particularly in the FRenderAssetStreamingSettings structure. It is used alongside other streaming-related variables to control various aspects of texture streaming behavior.

Developers should be aware that this variable affects how the engine handles texture quality in response to changes in the player’s view. Setting it too low might result in unnecessary texture quality degradation during brief FOV changes, while setting it too high might prevent the engine from appropriately adjusting texture quality in response to view changes.

Best practices when using this variable include:

  1. Keeping the default value unless specific issues with texture streaming are observed.
  2. If adjusting, do so incrementally and test thoroughly to ensure desired behavior across various scenarios.
  3. Consider the interplay between this variable and other texture streaming settings for optimal performance and visual quality.

The associated variable CVarStreamingPerTextureBiasViewBoostThreshold is the actual console variable that stores and provides access to the r.Streaming.PerTextureBiasViewBoostThreshold value. It is defined using TAutoConsoleVariable, which allows for runtime modification of the value.

This associated variable is used in the FRenderAssetStreamingSettings::Update function to populate the PerTextureBiasViewBoostThreshold member of the FRenderAssetStreamingSettings structure. This structure likely informs the broader texture streaming system about various configuration settings.

When working with CVarStreamingPerTextureBiasViewBoostThreshold, developers should:

  1. Use GetValueOnAnyThread() when accessing the value, as shown in the provided code.
  2. Be aware that changes to this variable will affect the behavior of the texture streaming system in real-time.
  3. Consider exposing this setting in user-facing graphics options if fine-tuning texture streaming is a desired feature for end-users.

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

Scope: file

Source code excerpt:


TAutoConsoleVariable<float> CVarStreamingPerTextureBiasViewBoostThreshold(
	TEXT("r.Streaming.PerTextureBiasViewBoostThreshold"),
	1.5,
	TEXT("Maximum view boost at which per texture bias will be increased.\n")
	TEXT("This prevents temporary small FOV from downgrading permanentely texture quality."),
	ECVF_Default
	);

#Associated Variable and Callsites

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

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

Scope: file

Source code excerpt:

	ECVF_Default);

TAutoConsoleVariable<float> CVarStreamingPerTextureBiasViewBoostThreshold(
	TEXT("r.Streaming.PerTextureBiasViewBoostThreshold"),
	1.5,
	TEXT("Maximum view boost at which per texture bias will be increased.\n")
	TEXT("This prevents temporary small FOV from downgrading permanentely texture quality."),
	ECVF_Default
	);

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

Scope (from outer to inner):

file
function     void FRenderAssetStreamingSettings::Update

Source code excerpt:

	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;
	LowResHandlingMode = (ELowResHandlingMode)CVarStreamingLowResHandlingMode.GetValueOnAnyThread();