r.VolumetricCloud.ShadowMap.Debug

r.VolumetricCloud.ShadowMap.Debug

#Overview

name: r.VolumetricCloud.ShadowMap.Debug

This variable is created as a Console Variable (cvar).

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of r.VolumetricCloud.ShadowMap.Debug is to enable debugging information for the volumetric cloud shadow map system in Unreal Engine 5. This setting variable is part of the rendering system, specifically focusing on the volumetric cloud rendering and shadow mapping functionality.

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 (CVarVolumetricCloudShadowMapDebug) with a default value of 0. It can be changed at runtime through console commands or programmatically.

This variable interacts with the associated variable CVarVolumetricCloudShadowMapDebug, which shares the same value and purpose. They are effectively the same variable, with one being the console variable representation and the other being the setting variable representation.

Developers must be aware that this variable is intended for debugging purposes only and should not be enabled in production builds. Enabling this debug mode may impact performance and generate additional output that is not necessary for regular gameplay.

Best practices when using this variable include:

  1. Only enable it when actively debugging volumetric cloud shadow map issues.
  2. Disable it when not needed to avoid performance overhead.
  3. Use it in conjunction with other debugging tools and methods to get a comprehensive understanding of the volumetric cloud rendering system.

Regarding the associated variable CVarVolumetricCloudShadowMapDebug:

The purpose of CVarVolumetricCloudShadowMapDebug is identical to r.VolumetricCloud.ShadowMap.Debug. It is the console variable representation of the same debugging functionality.

This console variable is used within the Renderer module, specifically in the volumetric cloud rendering system.

The value is set when the console variable is defined, with a default value of 0. It can be changed at runtime using console commands.

CVarVolumetricCloudShadowMapDebug interacts directly with r.VolumetricCloud.ShadowMap.Debug, as they represent the same functionality.

Developers should be aware that this console variable is checked on the render thread (ECVF_RenderThreadSafe) and is considered a scalability setting (ECVF_Scalability).

Best practices for using this console variable include:

  1. Use it for debugging purposes only in development builds.
  2. Access its value using GetValueOnRenderThread() when needed in render thread code.
  3. Consider the performance implications when enabling this debug mode, especially in complex scenes with volumetric clouds.

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/VolumetricCloudRendering.cpp:138

Scope: file

Source code excerpt:


static TAutoConsoleVariable<int32> CVarVolumetricCloudShadowMapDebug(
	TEXT("r.VolumetricCloud.ShadowMap.Debug"), 0,
	TEXT("Print information to debug the cloud shadow map."),
	ECVF_RenderThreadSafe | ECVF_Scalability);

static TAutoConsoleVariable<float> CVarVolumetricCloudShadowMapSnapLength(
	TEXT("r.VolumetricCloud.ShadowMap.SnapLength"), 20.0f,
	TEXT("Snapping size in kilometers of the cloud shadowmap position to avoid flickering."),

#Associated Variable and Callsites

This variable is associated with another variable named CVarVolumetricCloudShadowMapDebug. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/VolumetricCloudRendering.cpp:137

Scope: file

Source code excerpt:

	ECVF_RenderThreadSafe | ECVF_Scalability);

static TAutoConsoleVariable<int32> CVarVolumetricCloudShadowMapDebug(
	TEXT("r.VolumetricCloud.ShadowMap.Debug"), 0,
	TEXT("Print information to debug the cloud shadow map."),
	ECVF_RenderThreadSafe | ECVF_Scalability);

static TAutoConsoleVariable<float> CVarVolumetricCloudShadowMapSnapLength(
	TEXT("r.VolumetricCloud.ShadowMap.SnapLength"), 20.0f,

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/VolumetricCloudRendering.cpp:2524

Scope (from outer to inner):

file
function     bool FSceneRenderer::RenderVolumetricCloud

Source code excerpt:

			CloudRC.bSecondAtmosphereLightEnabled = Scene->IsSecondAtmosphereLightEnabled();

			const bool DebugCloudShadowMap = CVarVolumetricCloudShadowMapDebug.GetValueOnRenderThread() && ShouldRenderCloudShadowmap(AtmosphericLight0);
			const bool DebugCloudSkyAO = CVarVolumetricCloudSkyAODebug.GetValueOnRenderThread() && ShouldRenderCloudSkyAO(SkyLight);

			struct FLocalCloudView
			{
				FViewInfo* ViewInfo;
				bool bShouldViewRenderVolumetricCloudRenderTarget;