r.VT.Residency.Show
r.VT.Residency.Show
#Overview
name: r.VT.Residency.Show
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Show on screen HUD for virtual texture physical pool residency
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.VT.Residency.Show is to control the display of an on-screen HUD (Heads-Up Display) for virtual texture physical pool residency. This setting is part of Unreal Engine’s virtual texturing system, which is a key component of the rendering pipeline.
This setting variable is primarily used in the Renderer module of Unreal Engine, specifically within the virtual texturing subsystem. The code references are found in the VirtualTextureSystem.cpp file, which is part of the rendering system.
The value of this variable is set through a console variable (CVarVTResidencyShow) with a default value of 0. It can be changed at runtime using console commands or through game code.
The associated variable CVarVTResidencyShow directly interacts with r.VT.Residency.Show. They share the same value and purpose.
Developers should be aware that:
- This variable is primarily for debugging and profiling purposes.
- Enabling this HUD may have a performance impact, especially in complex scenes with many virtual textures.
- The HUD is only displayed when the value is non-zero.
Best practices when using this variable include:
- Use it during development and debugging phases, not in production builds.
- Combine it with other virtual texturing debug tools for a comprehensive understanding of the system’s performance.
- Be cautious about enabling it in performance-sensitive scenarios.
Regarding the associated variable CVarVTResidencyShow:
The purpose of CVarVTResidencyShow is identical to r.VT.Residency.Show. It’s an internal representation of the console variable used to control the virtual texture residency HUD display.
This variable is used directly in the FVirtualTextureSystem::DrawResidencyHud function to determine whether to draw the residency HUD. It’s accessed using the GetValueOnGameThread() method, indicating that it’s safe to read from the game thread.
The value of CVarVTResidencyShow is set when the console variable is registered, with a default value of 0.
Developers should be aware that:
- This is the actual variable that the engine code checks when determining whether to display the residency HUD.
- It’s thread-safe for reading from the game thread.
Best practices for using CVarVTResidencyShow include:
- Use the console command interface to modify this value during runtime for debugging.
- When accessing the value in code, use the appropriate thread-safe getter method (GetValueOnGameThread in this case).
- Consider exposing this setting in a developer-only UI for easier toggling during testing.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/VT/VirtualTextureSystem.cpp:140
Scope: file
Source code excerpt:
);
static TAutoConsoleVariable<int32> CVarVTResidencyShow(
TEXT("r.VT.Residency.Show"),
0,
TEXT("Show on screen HUD for virtual texture physical pool residency"),
ECVF_Default
);
static TAutoConsoleVariable<int32> CVarVTResidencyNotify(
TEXT("r.VT.Residency.Notify"),
#Associated Variable and Callsites
This variable is associated with another variable named CVarVTResidencyShow
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/VT/VirtualTextureSystem.cpp:139
Scope: file
Source code excerpt:
ECVF_RenderThreadSafe
);
static TAutoConsoleVariable<int32> CVarVTResidencyShow(
TEXT("r.VT.Residency.Show"),
0,
TEXT("Show on screen HUD for virtual texture physical pool residency"),
ECVF_Default
);
static TAutoConsoleVariable<int32> CVarVTResidencyNotify(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/VT/VirtualTextureSystem.cpp:2951
Scope (from outer to inner):
file
function void FVirtualTextureSystem::DrawResidencyHud
Source code excerpt:
void FVirtualTextureSystem::DrawResidencyHud(UCanvas* InCanvas, APlayerController* InController)
{
if (CVarVTResidencyShow.GetValueOnGameThread() == 0)
{
return;
}
int32 NumGraphs = 0;
for (int32 SpaceIndex = 0; SpaceIndex < PhysicalSpaces.Num(); ++SpaceIndex)