r.Upscale.Panini.ScreenFit

r.Upscale.Panini.ScreenFit

#Overview

name: r.Upscale.Panini.ScreenFit

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.Upscale.Panini.ScreenFit is to control the screen fit effect factor for the Panini projection in the Unreal Engine’s upscaling process. This setting is part of the rendering system, specifically the post-processing pipeline.

This setting variable is primarily used in the Renderer module of Unreal Engine, particularly in the post-processing upscale functionality. It’s referenced in the PostProcessUpscale.cpp file, which suggests it’s part of the upscaling process in the rendering pipeline.

The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of 1.0f, which means it fits horizontally by default. The value can be changed at runtime through console commands or programmatically.

The associated variable CVarUpscalePaniniScreenFit directly interacts with r.Upscale.Panini.ScreenFit. They share the same value and purpose. CVarUpscalePaniniScreenFit is used to access the value in the C++ code.

Developers must be aware that this variable affects how the Panini projection fits the screen during upscaling. A value of 0 fits vertically, while a value of 1 fits horizontally. Values between 0 and 1 will interpolate between these two extremes.

Best practices when using this variable include:

  1. Consider the aspect ratio of your target displays when adjusting this value.
  2. Test the visual results with different values to find the best fit for your specific use case.
  3. Be cautious when changing this value at runtime, as it may cause noticeable shifts in the rendered image.

Regarding the associated variable CVarUpscalePaniniScreenFit:

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessUpscale.cpp:34

Scope (from outer to inner):

file
namespace    anonymous

Source code excerpt:


TAutoConsoleVariable<float> CVarUpscalePaniniScreenFit(
	TEXT("r.Upscale.Panini.ScreenFit"),
	1.0f,
	TEXT("Panini projection screen fit effect factor (lerp).\n")
	TEXT(" 0: fit vertically\n")
	TEXT(" 1: fit horizontally (default)"),
	ECVF_RenderThreadSafe);

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessUpscale.cpp:33

Scope (from outer to inner):

file
namespace    anonymous

Source code excerpt:

	ECVF_RenderThreadSafe);

TAutoConsoleVariable<float> CVarUpscalePaniniScreenFit(
	TEXT("r.Upscale.Panini.ScreenFit"),
	1.0f,
	TEXT("Panini projection screen fit effect factor (lerp).\n")
	TEXT(" 0: fit vertically\n")
	TEXT(" 1: fit horizontally (default)"),
	ECVF_RenderThreadSafe);

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessUpscale.cpp:75

Scope (from outer to inner):

file
function     FPaniniProjectionConfig::FPaniniProjectionConfig

Source code excerpt:

		D = FMath::Max(CVarUpscalePaniniD.GetValueOnRenderThread(), 0.0f);
		S = CVarUpscalePaniniS.GetValueOnRenderThread();
		ScreenFit = FMath::Max(CVarUpscalePaniniScreenFit.GetValueOnRenderThread(), 0.0f);
	}
}

BEGIN_SHADER_PARAMETER_STRUCT(FPaniniProjectionParameters, )
	SHADER_PARAMETER(float, D)
	SHADER_PARAMETER(float, S)