r.TSR.ForceSeparateTranslucency

r.TSR.ForceSeparateTranslucency

#Overview

name: r.TSR.ForceSeparateTranslucency

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.TSR.ForceSeparateTranslucency is to override the separate translucency setting when Temporal Super Resolution (TSR) is enabled. It is primarily used in the rendering system, specifically for handling translucency in conjunction with TSR.

This setting variable is relied upon by the Unreal Engine’s Renderer module, as evidenced by its usage in the SceneRendering.cpp file.

The value of this variable is set using a TAutoConsoleVariable, which means it can be modified at runtime through console commands. By default, it is set to 1 (enabled).

This variable interacts with the ViewFamily.bAllowTranslucencyAfterDOF flag. When r.TSR.ForceSeparateTranslucency is enabled and TSR is being used (AAM_TSR), it forces the bAllowTranslucencyAfterDOF flag to be true, even if it was previously set to false.

Developers must be aware that this variable can override the default behavior of separate translucency when TSR is in use. This can affect rendering performance and visual quality, especially in scenes with complex translucent objects.

Best practices when using this variable include:

  1. Consider the performance implications of enabling separate translucency, especially on lower-end hardware.
  2. Test the visual quality with this setting both enabled and disabled to ensure the desired look is achieved.
  3. Be mindful of how this setting interacts with other rendering features, such as Depth of Field (DOF).

The associated variable CVarTSRForceSeparateTranslucency is the actual console variable that controls this setting. It shares the same value and purpose as r.TSR.ForceSeparateTranslucency. Developers can modify this variable through console commands to adjust the behavior at runtime, which can be useful for debugging or fine-tuning performance in different scenarios.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SceneRendering.cpp:262

Scope: file

Source code excerpt:


static TAutoConsoleVariable<int32> CVarTSRForceSeparateTranslucency(
	TEXT("r.TSR.ForceSeparateTranslucency"), 1,
	TEXT("Overrides r.SeparateTranslucency whenever TSR is enabled (enabled by default).\n"),
	ECVF_RenderThreadSafe);

static TAutoConsoleVariable<int32> CVarViewHasTileOffsetData(
	TEXT("r.ViewHasTileOffsetData"),
	1,

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SceneRendering.cpp:261

Scope: file

Source code excerpt:

	ECVF_RenderThreadSafe | ECVF_Default);

static TAutoConsoleVariable<int32> CVarTSRForceSeparateTranslucency(
	TEXT("r.TSR.ForceSeparateTranslucency"), 1,
	TEXT("Overrides r.SeparateTranslucency whenever TSR is enabled (enabled by default).\n"),
	ECVF_RenderThreadSafe);

static TAutoConsoleVariable<int32> CVarViewHasTileOffsetData(
	TEXT("r.ViewHasTileOffsetData"),

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SceneRendering.cpp:2898

Scope (from outer to inner):

file
function     FSceneRenderer::FSceneRenderer

Source code excerpt:

		ViewFamily.bAllowTranslucencyAfterDOF = SeparateTranslucencyEnabled && CVarAllowTranslucencyAfterDOF.GetValueOnAnyThread() != 0;

		if (!ViewFamily.bAllowTranslucencyAfterDOF && !bIsMobile && CVarTSRForceSeparateTranslucency.GetValueOnAnyThread() != 0)
		{
			for (FViewInfo* View : AllViews)
			{
				if (View->AntiAliasingMethod == AAM_TSR)
				{
					ViewFamily.bAllowTranslucencyAfterDOF = true;