r.BufferVisualizationOverviewTargets
r.BufferVisualizationOverviewTargets
#Overview
name: r.BufferVisualizationOverviewTargets
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Specify the list of post process materials that can be used in the buffer visualization overview. Put nothing between the commas to leave a gap.\n\n\tChoose from:\n\n BaseColor\n CustomDepth\n CustomStencil\n FinalImage\n ShadingModel\n MaterialAO\n Metallic\n Opacity\n Roughness\n Anisotropy\n SceneColor\n SceneDepth\n SeparateTranslucencyRGB\n SeparateTranslucencyA\n Specular\n SubsurfaceColor\n WorldNormal\n WorldTangent\n AmbientOcclusion\n CustomDepthWorldUnits\n SceneDepthWorldUnits\n Velocity\n PreTonemapHDRColor\n PostTonemapHDRColor
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.BufferVisualizationOverviewTargets is to specify a list of buffer visualization targets that can be used for debugging and inspecting various rendering passes in Unreal Engine 5. This console variable allows developers to define which render targets or material attributes should be available for visualization in the engine’s buffer visualization tool.
This setting variable is primarily used by the rendering system, specifically for debug visualization purposes. Based on the callsites, it is utilized by the following Unreal Engine subsystems and modules:
- Buffer Visualization System (BufferVisualizationData.cpp)
- Debug Camera Controller (DebugCameraController.cpp)
- Scene View (SceneView.cpp)
The value of this variable is set through the IConsoleManager, which means it can be modified at runtime via console commands or configuration files. The default value is a comma-separated list of buffer visualization targets, including BaseColor, Specular, SubsurfaceColor, WorldNormal, and many others.
This variable interacts with other components of the engine, such as:
- The FBufferVisualizationData class, which uses this variable to configure available visualization targets.
- The ADebugCameraController class, which retrieves the list of targets for debug camera functionality.
- The FSceneView class, which uses the variable to configure buffer visualization settings for scene rendering.
Developers should be aware of the following when using this variable:
- The list of targets is limited to 16 entries, as seen in the DebugCameraController.cpp callsite.
- Changes to this variable will affect the available options in the buffer visualization tool.
- The variable’s value is a comma-separated string, and empty entries are allowed (represented by adjacent commas).
Best practices when using this variable include:
- Only include relevant targets to avoid cluttering the visualization options.
- Ensure that the specified targets actually exist in the engine or your project’s custom shaders.
- Use meaningful and descriptive names for custom visualization targets.
- Remember to update this variable if you add new custom render targets or material attributes that you want to visualize.
- Be cautious when modifying this variable at runtime, as it may impact performance if many complex targets are included.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/BufferVisualizationData.cpp:119
Scope (from outer to inner):
file
function void FBufferVisualizationData::ConfigureConsoleCommand
Source code excerpt:
IConsoleManager::Get().RegisterConsoleVariable(
TEXT("r.BufferVisualizationOverviewTargets"),
TEXT("BaseColor,Specular,SubsurfaceColor,WorldNormal,SeparateTranslucencyRGB,,,WorldTangent,SeparateTranslucencyA,,,Opacity,SceneDepth,Roughness,Metallic,ShadingModel,,SceneDepthWorldUnits,SceneColor,PreTonemapHDRColor,PostTonemapHDRColor"),
*ConsoleDocumentationOverviewTargets,
ECVF_Default
);
}
const FBufferVisualizationData::Record* FBufferVisualizationData::GetRecord(FName InMaterialName) const
{
// Get UMaterial from the TMaterialMap FName
if (const Record* Result = MaterialMap.Find(InMaterialName))
{
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/DebugCameraController.cpp:772
Scope (from outer to inner):
file
function TArray<FString> ADebugCameraController::GetBufferVisualizationOverviewTargets
Source code excerpt:
// Get the list of requested buffers from the console
static IConsoleVariable* CVar = IConsoleManager::Get().FindConsoleVariable(TEXT("r.BufferVisualizationOverviewTargets"));
if (CVar)
{
FString SelectedBufferNames = CVar->GetString();
// Extract each material name from the comma separated string
while (SelectedBufferNames.Len() && SelectedBuffers.Num() < 16)
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/SceneView.cpp:2343
Scope (from outer to inner):
file
function void FSceneView::ConfigureBufferVisualizationSettings
Source code excerpt:
// Get the list of requested buffers from the console
static IConsoleVariable* CVar = IConsoleManager::Get().FindConsoleVariable(TEXT("r.BufferVisualizationOverviewTargets"));
FString SelectedMaterialNames = CVar->GetString();
FBufferVisualizationData& BufferVisualizationData = GetBufferVisualizationData();
if (BufferVisualizationData.IsDifferentToCurrentOverviewMaterialNames(SelectedMaterialNames))
{