r.PathTracing.ProgressDisplay

r.PathTracing.ProgressDisplay

#Overview

name: r.PathTracing.ProgressDisplay

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

It is referenced in 6 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of r.PathTracing.ProgressDisplay is to control the display of progress for path tracing in Unreal Engine 5’s rendering system. It enables or disables an in-frame display that shows progress towards the defined sample per pixel limit during path tracing.

This setting variable is primarily used in the rendering system, specifically in the path tracing subsystem. Based on the callsites, it is utilized in the main Renderer module and the MovieRenderPipeline plugin.

The value of this variable is set through a console variable (CVar) named CVarPathTracingProgressDisplay. It is initialized with a default value of 1 (enabled) and can be changed at runtime through console commands or programmatically.

The associated variable CVarPathTracingProgressDisplay directly interacts with r.PathTracing.ProgressDisplay. They share the same value and purpose.

Developers should be aware of the following when using this variable:

  1. It affects the visual feedback during path tracing, which can be useful for debugging or monitoring rendering progress.
  2. The progress display disappears when the maximum sample per pixel is reached and sample accumulation has stopped.
  3. In the MovieRenderPipeline plugin, this setting is temporarily disabled during rendering and restored afterward.

Best practices for using this variable include:

  1. Enable it (set to 1) during development and debugging to monitor path tracing progress.
  2. Disable it (set to 0) for final renders or when capturing footage to avoid the progress display appearing in the output.
  3. Be mindful of its state when using the MovieRenderPipeline, as it may affect the rendering process.

Regarding the associated variable CVarPathTracingProgressDisplay:

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PathTracing.cpp:250

Scope: file

Source code excerpt:


TAutoConsoleVariable<int32> CVarPathTracingProgressDisplay(
	TEXT("r.PathTracing.ProgressDisplay"),
	1,
	TEXT("Enables an in-frame display of progress towards the defined sample per pixel limit. The indicator dissapears when the maximum is reached and sample accumulation has stopped (default = 1)\n")
	TEXT("0: off\n")
	TEXT("1: on (default)\n"),
	ECVF_RenderThreadSafe
);

#Loc: <Workspace>/Engine/Plugins/MovieScene/MovieRenderPipeline/Source/MovieRenderPipelineRenderPasses/Private/Graph/Nodes/MovieGraphPathTracerPassNode.cpp:54

Scope (from outer to inner):

file
function     void UMovieGraphPathTracerRenderPassNode::SetupImpl

Source code excerpt:


	// Hide the progress display during the render
	if (IConsoleVariable* ProgressDisplayCvar = IConsoleManager::Get().FindConsoleVariable(TEXT("r.PathTracing.ProgressDisplay")))
	{
		bOriginalProgressDisplayCvarValue = ProgressDisplayCvar->GetBool();
		ProgressDisplayCvar->Set(false);
	}

	bool bSupportsPathTracing = false;

#Loc: <Workspace>/Engine/Plugins/MovieScene/MovieRenderPipeline/Source/MovieRenderPipelineRenderPasses/Private/Graph/Nodes/MovieGraphPathTracerPassNode.cpp:84

Scope (from outer to inner):

file
function     void UMovieGraphPathTracerRenderPassNode::TeardownImpl

Source code excerpt:


	// Restore the original setting for the progress display
	if (IConsoleVariable* ProgressDisplayCvar = IConsoleManager::Get().FindConsoleVariable(TEXT("r.PathTracing.ProgressDisplay")))
	{
		ProgressDisplayCvar->Set(bOriginalProgressDisplayCvarValue);
	}
}

FString UMovieGraphPathTracerRenderPassNode::GetRendererNameImpl() const

#Loc: <Workspace>/Engine/Plugins/MovieScene/MovieRenderPipeline/Source/MovieRenderPipelineRenderPasses/Public/Graph/Nodes/MovieGraphPathTracerPassNode.h:109

Scope (from outer to inner):

file
function     class MOVIERENDERPIPELINERENDERPASSES_API UMovieGraphPathTracerRenderPassNode : public UMovieGraphImagePassBaseNode { GENERATED_BODY

Source code excerpt:

private:
	/**
	 * The original value of the "r.PathTracing.ProgressDisplay" cvar before the render starts. The progress display
	 * will be hidden during the render.
	 */
	bool bOriginalProgressDisplayCvarValue = false;
};

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PathTracing.cpp:249

Scope: file

Source code excerpt:

);

TAutoConsoleVariable<int32> CVarPathTracingProgressDisplay(
	TEXT("r.PathTracing.ProgressDisplay"),
	1,
	TEXT("Enables an in-frame display of progress towards the defined sample per pixel limit. The indicator dissapears when the maximum is reached and sample accumulation has stopped (default = 1)\n")
	TEXT("0: off\n")
	TEXT("1: on (default)\n"),
	ECVF_RenderThreadSafe

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PathTracing.cpp:3319

Scope: file

Source code excerpt:

	DisplayParameters->Iteration = Config.PathTracingData.Iteration;
	DisplayParameters->MaxSamples = MaxSPP;
	DisplayParameters->ProgressDisplayEnabled = CVarPathTracingProgressDisplay.GetValueOnRenderThread();
	DisplayParameters->AdaptiveSamplingErrorThreshold = Config.AdaptiveSamplingThreshold;
	DisplayParameters->AdaptiveSamplingVisualize = CVarPathTracingAdaptiveSamplingVisualize.GetValueOnRenderThread();
	DisplayParameters->VarianceTextureDims = FIntVector(DispatchResX, DispatchResY, NumVarianceMips);
	DisplayParameters->ViewUniformBuffer = View.ViewUniformBuffer;
	DisplayParameters->RadianceTexture = GraphBuilder.CreateSRV(FRDGTextureSRVDesc::Create(DenoisedRadianceTexture ? DenoisedRadianceTexture : RadianceTexture));
	DisplayParameters->VarianceTexture = GraphBuilder.CreateSRV(FRDGTextureSRVDesc::Create(VarianceTexture ? VarianceTexture : GSystemTextures.GetBlackDummy(GraphBuilder)));