ShowFlag.VirtualTexturePendingMips

ShowFlag.VirtualTexturePendingMips

#Overview

name: ShowFlag.VirtualTexturePendingMips

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

It is referenced in 5 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of ShowFlag.VirtualTexturePendingMips is to enable a debug visualization mode that compares the required mip level to the resident virtual texture mip level in Unreal Engine 5’s rendering system.

This setting variable is primarily used in the rendering subsystem of Unreal Engine 5, specifically in the base pass rendering and debug view shader mode selection. It is part of the engine’s show flags, which are used to toggle various debug and visualization features.

The value of this variable is typically set through the engine’s show flags system, which allows developers to toggle various debug visualizations in the editor or at runtime.

ShowFlag.VirtualTexturePendingMips interacts with other debug visualization flags, such as RequiredTextureResolution, MaterialTextureScaleAccuracy, and ShaderComplexity. It is often checked alongside these other flags to determine which debug view mode should be active.

Developers should be aware that this flag is only available in non-shipping builds, as indicated by the SHOWFLAG_FIXED_IN_SHIPPING macro. This means it’s intended for development and debugging purposes, not for use in final, released games.

Best practices for using this variable include:

  1. Use it in conjunction with other texture-related debug flags to get a comprehensive view of virtual texture performance.
  2. Be aware that enabling this flag may impact performance, so it should be used judiciously during development and disabled for performance testing and final builds.
  3. Use this flag to identify areas where virtual textures might be causing performance issues due to pending mip levels.

The associated variable VirtualTexturePendingMips serves the same purpose and is used interchangeably with ShowFlag.VirtualTexturePendingMips in the codebase. It is referenced in similar contexts, particularly in shader mode selection and render pass setup. The same considerations and best practices apply to this associated variable.

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/ShowFlagsValues.inl:375

Scope: file

Source code excerpt:

SHOWFLAG_FIXED_IN_SHIPPING(0, RequiredTextureResolution, SFG_Hidden, NSLOCTEXT("UnrealEd", "RequiredTextureResolution", "Required Texture Resolution"))
/** Compare the required mip level to the resident virtual texture mip level. */
SHOWFLAG_FIXED_IN_SHIPPING(0, VirtualTexturePendingMips, SFG_Hidden, NSLOCTEXT("UnrealEd", "VirtualTexturePendingMips", "Virtual Texture Pending Mips"))
/** If WidgetComponents should be rendered in the scene */
SHOWFLAG_ALWAYS_ACCESSIBLE(WidgetComponents, SFG_Normal, NSLOCTEXT("UnrealEd", "WidgetComponentsSF", "Widget Components"))
/** Draw the bones of all skeletal meshes */
SHOWFLAG_FIXED_IN_SHIPPING(0, Bones, SFG_Developer, NSLOCTEXT("UnrealEd", "BoneSF", "Bones"))
/** Draw debug rendering from the Dedicated Server during Play In Editor (with Use Dedicated Server checked) in this client viewport */
SHOWFLAG_FIXED_IN_SHIPPING(0, ServerDrawDebug, SFG_Developer, NSLOCTEXT("UnrealEd", "ServerDrawDebugSF", "Dedicated Server Debug Drawing"))

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/SceneView.cpp:3091

Scope (from outer to inner):

file
function     EDebugViewShaderMode FSceneViewFamily::ChooseDebugViewShaderMode

Source code excerpt:

		return DVSM_RequiredTextureResolution;
	}
	else if (EngineShowFlags.VirtualTexturePendingMips)
	{
		return DVSM_VirtualTexturePendingMips;
	}
	else if (EngineShowFlags.LODColoration || EngineShowFlags.HLODColoration)
	{
		return DVSM_LODColoration;

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/ShowFlags.cpp:752

Scope: file

Source code excerpt:

		return VMI_RequiredTextureResolution;
	}
	else if (EngineShowFlags.VirtualTexturePendingMips)
	{
		return VMI_RequiredTextureResolution;
	}
	else if (EngineShowFlags.ShaderComplexity)
	{
		return VMI_ShaderComplexity;

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/ShowFlagsValues.inl:375

Scope: file

Source code excerpt:

SHOWFLAG_FIXED_IN_SHIPPING(0, RequiredTextureResolution, SFG_Hidden, NSLOCTEXT("UnrealEd", "RequiredTextureResolution", "Required Texture Resolution"))
/** Compare the required mip level to the resident virtual texture mip level. */
SHOWFLAG_FIXED_IN_SHIPPING(0, VirtualTexturePendingMips, SFG_Hidden, NSLOCTEXT("UnrealEd", "VirtualTexturePendingMips", "Virtual Texture Pending Mips"))
/** If WidgetComponents should be rendered in the scene */
SHOWFLAG_ALWAYS_ACCESSIBLE(WidgetComponents, SFG_Normal, NSLOCTEXT("UnrealEd", "WidgetComponentsSF", "Widget Components"))
/** Draw the bones of all skeletal meshes */
SHOWFLAG_FIXED_IN_SHIPPING(0, Bones, SFG_Developer, NSLOCTEXT("UnrealEd", "BoneSF", "Bones"))
/** Draw debug rendering from the Dedicated Server during Play In Editor (with Use Dedicated Server checked) in this client viewport */
SHOWFLAG_FIXED_IN_SHIPPING(0, ServerDrawDebug, SFG_Developer, NSLOCTEXT("UnrealEd", "ServerDrawDebugSF", "Dedicated Server Debug Drawing"))

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/BasePassRendering.cpp:1041

Scope (from outer to inner):

file
function     void FDeferredShadingSceneRenderer::RenderBasePass

Source code excerpt:

	const bool bNeedsBeginRender = AllowDebugViewmodes() &&
		(ViewFamily.EngineShowFlags.RequiredTextureResolution ||
			ViewFamily.EngineShowFlags.VirtualTexturePendingMips ||
			ViewFamily.EngineShowFlags.MaterialTextureScaleAccuracy ||
			ViewFamily.EngineShowFlags.MeshUVDensityAccuracy ||
			ViewFamily.EngineShowFlags.PrimitiveDistanceAccuracy ||
			ViewFamily.EngineShowFlags.ShaderComplexity ||
			ViewFamily.EngineShowFlags.LODColoration ||
			ViewFamily.EngineShowFlags.HLODColoration);