r.TemporalAA.Upsampling

r.TemporalAA.Upsampling

#Overview

name: r.TemporalAA.Upsampling

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.TemporalAA.Upsampling is to control whether Temporal Anti-Aliasing (TAA) performs spatial and temporal upscaling as the primary screen percentage method.

This setting variable is primarily used in the rendering system of Unreal Engine, specifically in the anti-aliasing and screen percentage subsystems. It is referenced in the Engine module, as seen in the SceneView.cpp file.

The value of this variable is set through a console variable (CVar) named CVarEnableTemporalUpsample. It is initialized with a default value of 1, which means TAA performs spatial and temporal upscale as the screen percentage method by default.

The variable interacts with the AntiAliasingMethod and PrimaryScreenPercentageMethod variables. When Temporal Anti-Aliasing (AAM_TemporalAA) is used as the anti-aliasing method, and r.TemporalAA.Upsampling is set to a non-zero value, the PrimaryScreenPercentageMethod is set to TemporalUpscale.

Developers should be aware that this variable affects how screen percentage and anti-aliasing are handled in the rendering pipeline. Setting it to 0 will use a spatial upscale pass independently of TAA, while setting it to 1 (default) will make TAA perform both spatial and temporal upscaling.

Best practices when using this variable include:

  1. Consider the performance implications of enabling or disabling temporal upsampling.
  2. Test the visual quality differences between spatial and temporal upscaling for your specific use case.
  3. Be aware of how this setting interacts with other anti-aliasing and screen percentage settings in your project.

Regarding the associated variable CVarEnableTemporalUpsample:

The purpose of CVarEnableTemporalUpsample is to provide a console-accessible way to control the r.TemporalAA.Upsampling setting.

This variable is part of the Engine module and is used in the rendering system, specifically in the SceneView initialization process.

The value of CVarEnableTemporalUpsample is set when the console variable is created, with a default value of 1. It can be changed at runtime through console commands.

CVarEnableTemporalUpsample directly controls the behavior of the r.TemporalAA.Upsampling setting. When its value is non-zero, it enables temporal upsampling for TAA.

Developers should be aware that changing this variable at runtime will affect the rendering pipeline, potentially impacting performance and visual quality.

Best practices for using CVarEnableTemporalUpsample include:

  1. Use it for debugging or testing different upsampling configurations.
  2. Consider exposing it as a user-configurable setting if temporal upsampling quality is important for your project.
  3. Be cautious when changing its value during gameplay, as it may cause visual discontinuities.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/SceneView.cpp:310

Scope: file

Source code excerpt:


static TAutoConsoleVariable<int32> CVarEnableTemporalUpsample(
	TEXT("r.TemporalAA.Upsampling"),
	1,
	TEXT("Whether to do primary screen percentage with temporal AA or not.\n")
	TEXT(" 0: use spatial upscale pass independently of TAA;\n")
	TEXT(" 1: TemporalAA performs spatial and temporal upscale as screen percentage method (default)."),
	ECVF_Default);

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/SceneView.cpp:309

Scope: file

Source code excerpt:

	);

static TAutoConsoleVariable<int32> CVarEnableTemporalUpsample(
	TEXT("r.TemporalAA.Upsampling"),
	1,
	TEXT("Whether to do primary screen percentage with temporal AA or not.\n")
	TEXT(" 0: use spatial upscale pass independently of TAA;\n")
	TEXT(" 1: TemporalAA performs spatial and temporal upscale as screen percentage method (default)."),
	ECVF_Default);

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/SceneView.cpp:1031

Scope (from outer to inner):

file
function     FSceneView::FSceneView

Source code excerpt:

		PrimaryScreenPercentageMethod = EPrimaryScreenPercentageMethod::TemporalUpscale;
	}
	else if (AntiAliasingMethod == AAM_TemporalAA && CVarEnableTemporalUpsample.GetValueOnAnyThread() != 0)
	{
		PrimaryScreenPercentageMethod = EPrimaryScreenPercentageMethod::TemporalUpscale;
	}

	if (Family)
	{