ImgMedia.MipMapDebug
ImgMedia.MipMapDebug
#Overview
name: ImgMedia.MipMapDebug
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Display debug on mipmaps and tiles used by the ImgMedia plugin.\n 0: off (default)\n 1: on\n
It is referenced in 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of ImgMedia.MipMapDebug is to enable debug display for mipmaps and tiles used by the ImgMedia plugin in Unreal Engine 5.
This setting variable is primarily used by the ImgMedia plugin, which is part of the Media subsystem in Unreal Engine. It affects the debugging capabilities of the ImgMedia module, specifically for mipmap and tile-related functionality.
The value of this variable is set through the console or configuration files. It is defined as a TAutoConsoleVariable with a default value of 0 (off). Users can toggle it between 0 (off) and 1 (on) to enable or disable the debug display.
The main variable interacting with ImgMedia.MipMapDebug is CVarImgMediaMipMapDebugEnable, which is directly associated with it and shares the same value.
Developers should be aware that this variable is only effective in non-shipping and non-test builds. It’s primarily used for debugging purposes and should not be relied upon in production environments.
Best practices for using this variable include:
- Only enabling it when actively debugging mipmap or tile-related issues in the ImgMedia plugin.
- Disabling it when not needed to avoid unnecessary debug output.
- Being aware that it may impact performance when enabled, so it should be used judiciously.
Regarding the associated variable CVarImgMediaMipMapDebugEnable:
The purpose of CVarImgMediaMipMapDebugEnable is identical to ImgMedia.MipMapDebug, as they are directly linked.
It is used within the ImgMedia plugin to control the debug display of mipmap and tile information.
The value is set through the same console variable as ImgMedia.MipMapDebug.
This variable is used directly in the code to check whether debug information should be displayed. For example, in the FImgMediaMipMapInfo::Tick function, it’s used to determine if debug information should be shown.
Developers should be aware that this variable is checked on the game thread, which could potentially impact performance if checked frequently.
Best practices for using CVarImgMediaMipMapDebugEnable include:
- Using it in conjunction with appropriate debug visualization code.
- Ensuring it’s only enabled in development environments.
- Being mindful of its potential performance impact when enabled.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Plugins/Media/ImgMedia/Source/ImgMedia/Private/Assets/ImgMediaMipMapInfo.cpp:23
Scope: file
Source code excerpt:
static TAutoConsoleVariable<bool> CVarImgMediaMipMapDebugEnable(
TEXT("ImgMedia.MipMapDebug"),
0,
TEXT("Display debug on mipmaps and tiles used by the ImgMedia plugin.\n")
TEXT(" 0: off (default)\n")
TEXT(" 1: on\n"),
ECVF_Default);
#Loc: <Workspace>/Engine/Plugins/Media/ImgMedia/Source/ImgMedia/Private/ImgMediaSceneViewExtension.cpp:140
Scope (from outer to inner):
file
function void FImgMediaSceneViewExtension::CacheViewInfo
Source code excerpt:
#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
static const auto CVarMipMapDebug = IConsoleManager::Get().FindConsoleVariable(TEXT("ImgMedia.MipMapDebug"));
if (GEngine != nullptr && CVarMipMapDebug != nullptr && CVarMipMapDebug->GetBool())
{
const FString ViewName = InViewFamily.ProfileDescription.IsEmpty() ? TEXT("View") : InViewFamily.ProfileDescription;
GEngine->AddOnScreenDebugMessage(-1, 0.0f, FColor::Cyan, *FString::Printf(TEXT("%s location: [%s], direction: [%s]"), *ViewName, *Info.Location.ToString(), *View.GetViewDirection().ToString()));
}
#Associated Variable and Callsites
This variable is associated with another variable named CVarImgMediaMipMapDebugEnable
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Plugins/Media/ImgMedia/Source/ImgMedia/Private/Assets/ImgMediaMipMapInfo.cpp:22
Scope: file
Source code excerpt:
DECLARE_CYCLE_STAT(TEXT("ImgMedia MipMap Update Cache"), STAT_ImgMedia_MipMapUpdateCache, STATGROUP_Media);
static TAutoConsoleVariable<bool> CVarImgMediaMipMapDebugEnable(
TEXT("ImgMedia.MipMapDebug"),
0,
TEXT("Display debug on mipmaps and tiles used by the ImgMedia plugin.\n")
TEXT(" 0: off (default)\n")
TEXT(" 1: on\n"),
ECVF_Default);
#Loc: <Workspace>/Engine/Plugins/Media/ImgMedia/Source/ImgMedia/Private/Assets/ImgMediaMipMapInfo.cpp:1108
Scope (from outer to inner):
file
function void FImgMediaMipMapInfo::Tick
Source code excerpt:
// Display debug?
if (CVarImgMediaMipMapDebugEnable.GetValueOnGameThread() && GEngine != nullptr)
{
FScopeLock Lock(&InfoCriticalSection);
TSet<int32> VisibleMips;
int32 NumVisibleTiles = 0;