r.HeterogeneousVolumes.Debug
r.HeterogeneousVolumes.Debug
#Overview
name: r.HeterogeneousVolumes.Debug
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Creates auxillary output buffers for debugging (Default = 0)
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.HeterogeneousVolumes.Debug is to enable the creation of auxiliary output buffers for debugging heterogeneous volumes in Unreal Engine’s rendering system.
This setting variable is primarily used by the Renderer module, specifically within the HeterogeneousVolumes subsystem. It is defined and used in the HeterogeneousVolumes.cpp file, which is part of the rendering pipeline.
The value of this variable is set through a console variable (CVar) system. It is initialized with a default value of 0, meaning debug buffers are not created by default. Users can change this value at runtime using console commands or through configuration files.
The associated variable CVarHeterogeneousVolumesDebug interacts directly with r.HeterogeneousVolumes.Debug. It is used to access the current value of the debug setting within the C++ code.
Developers should be aware that enabling this debug mode (by setting the value to non-zero) will create additional output buffers, which may impact performance. Therefore, it should primarily be used during development and debugging phases, not in production builds.
Best practices for using this variable include:
- Only enable it when actively debugging heterogeneous volume rendering issues.
- Remember to disable it before creating production builds to avoid unnecessary performance overhead.
- Use in conjunction with other debugging tools and techniques to get a comprehensive view of the rendering process.
Regarding the associated variable CVarHeterogeneousVolumesDebug:
- Its purpose is to provide a programmatic interface to access the value of r.HeterogeneousVolumes.Debug within the C++ code.
- It is used within the HeterogeneousVolumes namespace, specifically in the GetDebugMode() function.
- The value is retrieved using the GetValueOnRenderThread() method, ensuring thread-safe access in the render thread.
- Developers should use this variable when they need to check the current debug mode within rendering code, particularly in conditional statements that determine whether to create or use the auxiliary debug buffers.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/HeterogeneousVolumes/HeterogeneousVolumes.cpp:51
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarHeterogeneousVolumesDebug(
TEXT("r.HeterogeneousVolumes.Debug"),
0,
TEXT("Creates auxillary output buffers for debugging (Default = 0)"),
ECVF_RenderThreadSafe
);
static TAutoConsoleVariable<int32> CVarHeterogeneousVolumesHardwareRayTracing(
#Associated Variable and Callsites
This variable is associated with another variable named CVarHeterogeneousVolumesDebug
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/HeterogeneousVolumes/HeterogeneousVolumes.cpp:50
Scope: file
Source code excerpt:
);
static TAutoConsoleVariable<int32> CVarHeterogeneousVolumesDebug(
TEXT("r.HeterogeneousVolumes.Debug"),
0,
TEXT("Creates auxillary output buffers for debugging (Default = 0)"),
ECVF_RenderThreadSafe
);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/HeterogeneousVolumes/HeterogeneousVolumes.cpp:425
Scope (from outer to inner):
file
namespace HeterogeneousVolumes
function int32 GetDebugMode
Source code excerpt:
int32 GetDebugMode()
{
return CVarHeterogeneousVolumesDebug.GetValueOnRenderThread();
}
EShadowMode GetShadowMode()
{
return static_cast<EShadowMode>(CVarHeterogeneousVolumesShadowMode.GetValueOnRenderThread());
}