r.RectLightAtlas.Debug
r.RectLightAtlas.Debug
#Overview
name: r.RectLightAtlas.Debug
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Enable rect. light atlas debug information.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.RectLightAtlas.Debug is to enable debug information for the rectangular light atlas in Unreal Engine’s rendering system. This console variable is used to control the visibility of debug information related to the rectangular light atlas, which is a part of the engine’s lighting system.
This setting variable is primarily used in the Renderer module of Unreal Engine. Specifically, it’s utilized in the RectLightTextureManager.cpp file, which is responsible for managing textures for rectangular lights.
The value of this variable is set through the console or configuration files. It’s defined as a TAutoConsoleVariable with an initial value of 0, meaning the debug information is disabled by default.
The associated variable CVarRectLighTextureDebug interacts directly with r.RectLightAtlas.Debug. They share the same value and purpose, with CVarRectLighTextureDebug being the C++ variable that’s used in the code to check the current setting.
Developers should be aware that enabling this debug information may have performance implications, as it adds additional rendering passes to display the debug output. It should primarily be used during development and debugging phases, not in production builds.
Best practices when using this variable include:
- Only enable it when actively debugging rectangular light atlas issues.
- Remember to disable it before creating production builds.
- Use in conjunction with other lighting debug tools for a comprehensive understanding of the lighting system.
Regarding the associated variable CVarRectLighTextureDebug:
The purpose of CVarRectLighTextureDebug is to provide a programmatic way to access the r.RectLightAtlas.Debug setting within the C++ code.
This variable is used in the Renderer module, specifically in the RectLightTextureManager.cpp file.
Its value is set automatically based on the r.RectLightAtlas.Debug console variable.
It interacts directly with r.RectLightAtlas.Debug, essentially serving as its in-code representation.
Developers should be aware that this variable is checked on the render thread (GetValueOnRenderThread()), which is important for thread safety in rendering code.
Best practices include using this variable for conditional code execution related to rectangular light atlas debugging, and ensuring that any code depending on this variable is properly synchronized with the render thread.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/RectLightTextureManager.cpp:35
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarRectLighTextureDebug(
TEXT("r.RectLightAtlas.Debug"),
0,
TEXT("Enable rect. light atlas debug information."),
ECVF_RenderThreadSafe);
static TAutoConsoleVariable<int32> CVarRectLighTextureDebugMipLevel(
TEXT("r.RectLightAtlas.Debug.MipLevel"),
#Associated Variable and Callsites
This variable is associated with another variable named CVarRectLighTextureDebug
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/RectLightTextureManager.cpp:34
Scope: file
Source code excerpt:
ECVF_RenderThreadSafe);
static TAutoConsoleVariable<int32> CVarRectLighTextureDebug(
TEXT("r.RectLightAtlas.Debug"),
0,
TEXT("Enable rect. light atlas debug information."),
ECVF_RenderThreadSafe);
static TAutoConsoleVariable<int32> CVarRectLighTextureDebugMipLevel(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/RectLightTextureManager.cpp:1683
Scope (from outer to inner):
file
namespace RectLightAtlas
function void AddDebugPass
Source code excerpt:
void AddDebugPass(FRDGBuilder& GraphBuilder, const FViewInfo& View, FRDGTextureRef OutputTexture)
{
if (CVarRectLighTextureDebug.GetValueOnRenderThread() > 0 && ShaderPrint::IsSupported(View.Family->GetShaderPlatform()))
{
if (FRDGTextureRef DebugOutput = AddRectLightDebugInfoPass(GraphBuilder, View, OutputTexture->Desc))
{
// Debug output is blend on top of the SceneColor/OutputTexture, as debug pass is a CS pass, and SceneColor/OutputTexture might not have a UAV flag
FCopyRectPS::FParameters* Parameters = GraphBuilder.AllocParameters<FCopyRectPS::FParameters>();
Parameters->InputTexture = DebugOutput;