r.VolumetricCloud.SkyAO.Debug
r.VolumetricCloud.SkyAO.Debug
#Overview
name: r.VolumetricCloud.SkyAO.Debug
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Print information to debug the cloud sky AO map.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.VolumetricCloud.SkyAO.Debug is to enable debugging information for the cloud sky Ambient Occlusion (AO) map in Unreal Engine’s volumetric cloud rendering system.
-
This setting variable is part of the rendering system, specifically the volumetric cloud rendering subsystem.
-
The Unreal Engine subsystem that relies on this setting variable is the Renderer module, as evidenced by its location in the “VolumetricCloudRendering.cpp” file within the Runtime/Renderer/Private directory.
-
The value of this variable is set using a console variable (CVar) system. It is defined as a TAutoConsoleVariable with an initial value of 0, which means debugging is disabled by default.
-
This variable interacts with other volumetric cloud rendering variables, particularly those related to sky Ambient Occlusion. It’s used in conjunction with ShouldRenderCloudSkyAO() function to determine whether to debug the cloud sky AO.
-
Developers must be aware that enabling this debug option may impact performance, as it will print additional information. It should primarily be used during development and testing phases, not in production builds.
-
Best practices when using this variable include:
- Only enable it when specifically debugging cloud sky AO issues.
- Remember to disable it after debugging to avoid unnecessary performance overhead.
- Use it in conjunction with other cloud rendering debug tools for a comprehensive understanding of the rendering process.
Regarding the associated variable CVarVolumetricCloudSkyAODebug:
This is the actual console variable object that controls the r.VolumetricCloud.SkyAO.Debug setting. It’s an int32 variable, suggesting that it might support multiple debug levels or options in the future, although it’s currently used as a boolean (0 for off, non-zero for on).
The CVarVolumetricCloudSkyAODebug variable is used directly in the rendering code to check if debugging should be enabled. For example, in the RenderVolumetricCloud function, it’s queried using GetValueOnRenderThread() to determine if cloud sky AO debugging should be performed for the current frame.
When working with this variable, developers should:
- Access its value using GetValueOnRenderThread() when in render thread code.
- Be aware that changes to this variable will affect rendering in real-time, allowing for on-the-fly debugging.
- Consider adding additional debug levels or options if more detailed debugging information is required in the future.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/VolumetricCloudRendering.cpp:106
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarVolumetricCloudSkyAODebug(
TEXT("r.VolumetricCloud.SkyAO.Debug"), 0,
TEXT("Print information to debug the cloud sky AO map."),
ECVF_RenderThreadSafe | ECVF_Scalability);
static TAutoConsoleVariable<float> CVarVolumetricCloudSkyAOSnapLength(
TEXT("r.VolumetricCloud.SkyAO.SnapLength"), 20.0f,
TEXT("Snapping size in kilometers of the cloud sky AO texture position to avoid flickering."),
#Associated Variable and Callsites
This variable is associated with another variable named CVarVolumetricCloudSkyAODebug
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/VolumetricCloudRendering.cpp:105
Scope: file
Source code excerpt:
ECVF_RenderThreadSafe | ECVF_Scalability);
static TAutoConsoleVariable<int32> CVarVolumetricCloudSkyAODebug(
TEXT("r.VolumetricCloud.SkyAO.Debug"), 0,
TEXT("Print information to debug the cloud sky AO map."),
ECVF_RenderThreadSafe | ECVF_Scalability);
static TAutoConsoleVariable<float> CVarVolumetricCloudSkyAOSnapLength(
TEXT("r.VolumetricCloud.SkyAO.SnapLength"), 20.0f,
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/VolumetricCloudRendering.cpp:2525
Scope (from outer to inner):
file
function bool FSceneRenderer::RenderVolumetricCloud
Source code excerpt:
const bool DebugCloudShadowMap = CVarVolumetricCloudShadowMapDebug.GetValueOnRenderThread() && ShouldRenderCloudShadowmap(AtmosphericLight0);
const bool DebugCloudSkyAO = CVarVolumetricCloudSkyAODebug.GetValueOnRenderThread() && ShouldRenderCloudSkyAO(SkyLight);
struct FLocalCloudView
{
FViewInfo* ViewInfo;
bool bShouldViewRenderVolumetricCloudRenderTarget;
bool bEnableAerialPerspectiveSampling;