ShowFlag.MaterialTextureScaleAccuracy
ShowFlag.MaterialTextureScaleAccuracy
#Overview
name: ShowFlag.MaterialTextureScaleAccuracy
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Allows to override a specific showflag (works in editor and game, \
It is referenced in 5
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of ShowFlag.MaterialTextureScaleAccuracy is to visualize the accuracy of CPU material texture scales when compared to the GPU values in Unreal Engine 5. This setting is primarily used for debugging and optimization purposes within the rendering system.
This setting variable is relied upon by the rendering subsystem of Unreal Engine 5, specifically within the base pass rendering module. It’s used in conjunction with other debug view modes to provide visual feedback on material texture scaling.
The value of this variable is set through the engine show flags, which are typically controlled via the editor interface or through code. It’s defined as a show flag that is fixed (not available) in shipping builds, indicating its use is primarily for development and debugging.
ShowFlag.MaterialTextureScaleAccuracy interacts with several other variables, including:
- RequiredTextureResolution
- VirtualTexturePendingMips
- MeshUVDensityAccuracy
- OutputMaterialTextureScales
These variables are often used together to provide a comprehensive debug view of texture-related rendering aspects.
Developers should be aware that this variable is only available in non-shipping builds and is intended for debugging purposes. It’s part of a set of debug view modes that can impact rendering performance when enabled.
Best practices when using this variable include:
- Only enable it when specifically debugging material texture scale issues.
- Use it in conjunction with other related debug views for a more comprehensive analysis.
- Remember to disable it before final builds or performance testing.
The associated variable MaterialTextureScaleAccuracy serves the same purpose and is used interchangeably with ShowFlag.MaterialTextureScaleAccuracy. It’s used to determine the debug view shader mode and visualization mode index in various parts of the rendering pipeline. 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:369
Scope: file
Source code excerpt:
SHOWFLAG_FIXED_IN_SHIPPING(0, MeshUVDensityAccuracy, SFG_Hidden, NSLOCTEXT("UnrealEd", "MeshUVDensityAccuracy", "Mesh UV Densities Accuracy"))
/** Visualize the accuracy of CPU material texture scales when compared to the GPU values */
SHOWFLAG_FIXED_IN_SHIPPING(0, MaterialTextureScaleAccuracy, SFG_Hidden, NSLOCTEXT("UnrealEd", "MaterialTextureScaleAccuracy", "Material Texture Scales Accuracy"))
/** Outputs the material texture scales. */
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"))
#Associated Variable and Callsites
This variable is associated with another variable named MaterialTextureScaleAccuracy
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/SceneView.cpp:3083
Scope (from outer to inner):
file
function EDebugViewShaderMode FSceneViewFamily::ChooseDebugViewShaderMode
Source code excerpt:
return DVSM_OutputMaterialTextureScales;
}
else if (EngineShowFlags.MaterialTextureScaleAccuracy)
{
return DVSM_MaterialTextureScaleAccuracy;
}
else if (EngineShowFlags.RequiredTextureResolution)
{
return DVSM_RequiredTextureResolution;
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/ShowFlags.cpp:744
Scope: file
Source code excerpt:
return VMI_MeshUVDensityAccuracy;
}
else if (EngineShowFlags.MaterialTextureScaleAccuracy)
{
return VMI_MaterialTextureScaleAccuracy;
}
else if (EngineShowFlags.RequiredTextureResolution)
{
return VMI_RequiredTextureResolution;
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/ShowFlagsValues.inl:369
Scope: file
Source code excerpt:
SHOWFLAG_FIXED_IN_SHIPPING(0, MeshUVDensityAccuracy, SFG_Hidden, NSLOCTEXT("UnrealEd", "MeshUVDensityAccuracy", "Mesh UV Densities Accuracy"))
/** Visualize the accuracy of CPU material texture scales when compared to the GPU values */
SHOWFLAG_FIXED_IN_SHIPPING(0, MaterialTextureScaleAccuracy, SFG_Hidden, NSLOCTEXT("UnrealEd", "MaterialTextureScaleAccuracy", "Material Texture Scales Accuracy"))
/** Outputs the material texture scales. */
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"))
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/BasePassRendering.cpp:1042
Scope (from outer to inner):
file
function void FDeferredShadingSceneRenderer::RenderBasePass
Source code excerpt:
(ViewFamily.EngineShowFlags.RequiredTextureResolution ||
ViewFamily.EngineShowFlags.VirtualTexturePendingMips ||
ViewFamily.EngineShowFlags.MaterialTextureScaleAccuracy ||
ViewFamily.EngineShowFlags.MeshUVDensityAccuracy ||
ViewFamily.EngineShowFlags.PrimitiveDistanceAccuracy ||
ViewFamily.EngineShowFlags.ShaderComplexity ||
ViewFamily.EngineShowFlags.LODColoration ||
ViewFamily.EngineShowFlags.HLODColoration);