r.SceneCapture.EnableOrthographicTiling

r.SceneCapture.EnableOrthographicTiling

#Overview

name: r.SceneCapture.EnableOrthographicTiling

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.SceneCapture.EnableOrthographicTiling is to control the rendering of scene captures in orthographic mode using a tiling technique. This setting is specifically for the rendering system, particularly for scene capture components.

This setting variable is primarily used by the Engine module, specifically within the SceneCaptureComponent subsystem. It’s referenced in the SceneCaptureComponent.cpp file, which is part of the core rendering functionality in Unreal Engine.

The value of this variable is set as a console variable (CVar) with a default value of false. It can be modified at runtime through the console or in configuration files.

The variable interacts with several other variables, notably:

  1. r.SceneCapture.OverrideOrthographicTilingValues
  2. r.SceneCapture.OrthographicNumXTiles
  3. r.SceneCapture.OrthographicNumYTiles

Developers must be aware that:

  1. This setting only works in Orthographic mode, not in Perspective mode.
  2. It’s only effective when r.SceneCapture.OverrideOrthographicTilingValues is enabled.
  3. When enabled, it causes the scene to be rendered in multiple frames (tiles), which can impact performance but may be necessary for high-resolution orthographic captures.

Best practices when using this variable include:

  1. Only enable it when necessary for high-resolution orthographic scene captures.
  2. Consider the performance impact, especially in scenes with complex geometry or lighting.
  3. Ensure r.SceneCapture.OverrideOrthographicTilingValues is also enabled when using this feature.
  4. Adjust the number of X and Y tiles (using the related CVars) to balance quality and performance.

Regarding the associated variable CVarSCEnableOrthographicTiling:

This is the actual console variable object that controls the r.SceneCapture.EnableOrthographicTiling setting. It’s defined as a TAutoConsoleVariable, which means it’s a boolean console variable that can be changed at runtime.

The purpose of CVarSCEnableOrthographicTiling is to provide a programmatic way to access and modify the r.SceneCapture.EnableOrthographicTiling setting within the engine’s C++ code.

It’s used in the USceneCaptureComponent2D::GetEnableOrthographicTiling() function to determine whether orthographic tiling is enabled for scene captures. This function likely influences the rendering behavior of scene capture components when in orthographic mode.

Developers should be aware that changes to this variable will directly affect the behavior of orthographic scene captures. When working with scene capture components, especially in orthographic mode, it’s important to check the state of this variable to understand how the capture will be rendered.

Best practices for using CVarSCEnableOrthographicTiling include:

  1. Use the GetBool() method to check its current state before performing orthographic scene captures.
  2. Consider exposing this setting in user-facing configuration options if orthographic tiling is a feature that end-users might need to control.
  3. Be cautious about changing this value frequently during runtime, as it could lead to inconsistent rendering behavior.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Components/SceneCaptureComponent.cpp:52

Scope: file

Source code excerpt:


static TAutoConsoleVariable<bool> CVarSCEnableOrthographicTiling(
	TEXT("r.SceneCapture.EnableOrthographicTiling"),
	false,
	TEXT("Render the scene in n frames (i.e TileCount) - Ignored in Perspective mode, works only in Orthographic mode and when r.SceneCapture.OverrideOrthographicTilingValues is on."),
	ECVF_Scalability);

static TAutoConsoleVariable<int32> CVarSCOrthographicNumXTiles(
	TEXT("r.SceneCapture.OrthographicNumXTiles"),

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Components/SceneCaptureComponent.cpp:51

Scope: file

Source code excerpt:

	ECVF_Scalability);

static TAutoConsoleVariable<bool> CVarSCEnableOrthographicTiling(
	TEXT("r.SceneCapture.EnableOrthographicTiling"),
	false,
	TEXT("Render the scene in n frames (i.e TileCount) - Ignored in Perspective mode, works only in Orthographic mode and when r.SceneCapture.OverrideOrthographicTilingValues is on."),
	ECVF_Scalability);

static TAutoConsoleVariable<int32> CVarSCOrthographicNumXTiles(

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Components/SceneCaptureComponent.cpp:892

Scope (from outer to inner):

file
function     bool USceneCaptureComponent2D::GetEnableOrthographicTiling

Source code excerpt:

	}

	return CVarSCEnableOrthographicTiling->GetBool();
}

int32 USceneCaptureComponent2D::GetNumXTiles() const
{
	if (!CVarSCOverrideOrthographicTilingValues->GetBool())
	{