r.PostProcessing.GBufferPicking

r.PostProcessing.GBufferPicking

#Overview

name: r.PostProcessing.GBufferPicking

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

It is referenced in 4 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of r.PostProcessing.GBufferPicking is to enable a debugging feature for evaluating GBuffer values in Unreal Engine’s rendering pipeline. Here’s a detailed explanation:

  1. This setting variable is used for debugging purposes in the post-processing stage of rendering.

  2. It is primarily used in the editor environment, as indicated by the #if WITH_EDITOR preprocessor directive.

  3. The Unreal Engine rendering subsystem, specifically the post-processing module, relies on this variable.

  4. The value of this variable is set through the console variable system (CVarGBufferPicking).

  5. It interacts with the AddGBufferPicking function, which is called when this feature is enabled.

  6. Developers must be aware that:

    • This is a debugging feature and should not be enabled in shipping builds.
    • It may have performance implications when enabled.
    • It forces ShaderPrint to be enabled when active.
  7. Best practices for using this variable:

    • Only enable it when debugging GBuffer-related issues.
    • Disable it in performance-critical scenarios.
    • Use in conjunction with other debugging tools for a comprehensive analysis.

The associated variable CVarGBufferPicking is used to control this feature. It is defined as a console variable that can be toggled at runtime. When its value is greater than 0 and the feature is supported on the current shader platform, the GBuffer picking functionality is enabled.

Developers should use this feature cautiously and only when necessary for debugging GBuffer-related issues in the editor environment. It’s important to ensure that this feature is disabled in shipping builds to avoid any potential performance impact.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessing.cpp:147

Scope (from outer to inner):

file
namespace    anonymous

Source code excerpt:

#if WITH_EDITOR
TAutoConsoleVariable<int32> CVarGBufferPicking(
	TEXT("r.PostProcessing.GBufferPicking"), 0,
	TEXT("Evaluate GBuffer value for debugging purpose."),
	ECVF_RenderThreadSafe);
#endif
}

#if WITH_EDITOR

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessing.cpp:146

Scope (from outer to inner):

file
namespace    anonymous

Source code excerpt:


#if WITH_EDITOR
TAutoConsoleVariable<int32> CVarGBufferPicking(
	TEXT("r.PostProcessing.GBufferPicking"), 0,
	TEXT("Evaluate GBuffer value for debugging purpose."),
	ECVF_RenderThreadSafe);
#endif
}

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessing.cpp:1764

Scope (from outer to inner):

file
function     void AddPostProcessingPasses

Source code excerpt:


		#if WITH_EDITOR
		if (CVarGBufferPicking.GetValueOnRenderThread())
		{
			AddGBufferPicking(GraphBuilder, View, Inputs.SceneTextures);
		}
		#endif

		{

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessing.cpp:3086

Scope (from outer to inner):

file
function     static void AddGBufferPicking

Source code excerpt:

static void AddGBufferPicking(FRDGBuilder& GraphBuilder, const FViewInfo& View, const TRDGUniformBufferRef<FSceneTextureUniformParameters>& SceneTextures)
{
	if (CVarGBufferPicking.GetValueOnRenderThread() <= 0 || !FGBufferPickingCS::IsSupported(View.Family->GetShaderPlatform()))
	{
		return;
	}

	// Force ShaderPrint on.
	ShaderPrint::SetEnabled(true);