ShowFlag.RequiredTextureResolution

ShowFlag.RequiredTextureResolution

#Overview

name: ShowFlag.RequiredTextureResolution

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.RequiredTextureResolution is to enable a debug visualization mode that compares the required texture resolution to the actual resolution in the rendering system. This setting is primarily used for debugging and optimization purposes in Unreal Engine’s rendering pipeline.

This setting variable is primarily relied upon by the Unreal Engine’s rendering subsystem. It is referenced in the Engine and Renderer modules, specifically in the scene view and base pass rendering components.

The value of this variable is set through the engine’s show flags system, which allows developers to toggle various debug visualization modes. It’s typically controlled via the editor interface or through code by modifying the EngineShowFlags structure.

ShowFlag.RequiredTextureResolution interacts closely with other texture-related debug visualization modes, such as VirtualTexturePendingMips and MaterialTextureScaleAccuracy. It’s part of a suite of tools used for analyzing texture usage and performance in a scene.

Developers should be aware that this variable is marked as SHOWFLAG_FIXED_IN_SHIPPING(0), which means it’s not available in shipping builds. It’s intended for use in development and debugging scenarios only.

Best practices for using this variable include:

  1. Use it in conjunction with other texture-related debug modes to get a comprehensive view of texture usage in your scene.
  2. Be aware that enabling this flag may impact performance, so it should be used judiciously during development and optimization phases.
  3. Remember that this visualization is not available in shipping builds, so any issues identified should be resolved before final release.

Regarding the associated variable RequiredTextureResolution:

The purpose of RequiredTextureResolution is essentially the same as ShowFlag.RequiredTextureResolution. It’s used internally to represent the state of the show flag and determine the debug view shader mode.

This variable is used in the Engine module, specifically in the SceneView and ShowFlags components. It’s set based on the state of the corresponding show flag.

The value of this variable is directly tied to the ShowFlag.RequiredTextureResolution. When the show flag is enabled, this variable is set to true, which in turn affects the debug view shader mode.

RequiredTextureResolution interacts with other debug view modes and is used to determine which specific visualization should be rendered.

Developers should be aware that this variable is part of the internal implementation of the show flags system and typically shouldn’t be modified directly. Instead, they should work with the ShowFlag.RequiredTextureResolution to control this functionality.

Best practices for this variable align with those of ShowFlag.RequiredTextureResolution, as they are directly linked. Developers should primarily interact with the show flag rather than this internal 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:373

Scope: file

Source code excerpt:

SHOWFLAG_FIXED_IN_SHIPPING(0, OutputMaterialTextureScales, SFG_Hidden, NSLOCTEXT("UnrealEd", "OutputMaterialTextureScales", "Output Material Texture Scales"))
/** Compare the required texture resolution to the actual resolution. */
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"))

#Associated Variable and Callsites

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

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

Scope (from outer to inner):

file
function     EDebugViewShaderMode FSceneViewFamily::ChooseDebugViewShaderMode

Source code excerpt:

		return DVSM_MaterialTextureScaleAccuracy;
	}
	else if (EngineShowFlags.RequiredTextureResolution)
	{
		return DVSM_RequiredTextureResolution;
	}
	else if (EngineShowFlags.VirtualTexturePendingMips)
	{
		return DVSM_VirtualTexturePendingMips;

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

Scope: file

Source code excerpt:

		return VMI_MaterialTextureScaleAccuracy;
	}
	else if (EngineShowFlags.RequiredTextureResolution)
	{
		return VMI_RequiredTextureResolution;
	}
	else if (EngineShowFlags.VirtualTexturePendingMips)
	{
		return VMI_RequiredTextureResolution;

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

Scope: file

Source code excerpt:

SHOWFLAG_FIXED_IN_SHIPPING(0, OutputMaterialTextureScales, SFG_Hidden, NSLOCTEXT("UnrealEd", "OutputMaterialTextureScales", "Output Material Texture Scales"))
/** Compare the required texture resolution to the actual resolution. */
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"))

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

Scope (from outer to inner):

file
function     void FDeferredShadingSceneRenderer::RenderBasePass

Source code excerpt:

	const bool bDoParallelBasePass = bEnableParallelBasePasses && !bDebugViewMode && !bRenderLightmapDensity; // DebugView and LightmapDensity are non-parallel substitutions inside BasePass
	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 ||