r.Upscale.Panini.S
r.Upscale.Panini.S
#Overview
name: r.Upscale.Panini.S
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Panini projection\'s hard vertical compression factor.\n 0: no vertical compression factor (default)\n 1: Hard vertical compression
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Upscale.Panini.S is to control the hard vertical compression factor in the Panini projection used in the Unreal Engine’s upscaling process. This setting is part of the rendering system, specifically related to post-processing and image upscaling.
This setting variable is primarily used in the Renderer module of Unreal Engine, as evidenced by its location in the PostProcessUpscale.cpp file within the Runtime/Renderer/Private/PostProcess directory.
The value of this variable is set through the console variable system (CVarUpscalePaniniS). It’s initialized with a default value of 0, which means no vertical compression is applied by default.
The associated variable CVarUpscalePaniniS directly interacts with r.Upscale.Panini.S, as they share the same value. This variable is used to retrieve the current value of the setting in the rendering thread.
Developers should be aware that:
- This variable affects the Panini projection, which is a type of image warping used to reduce distortion in wide-angle views.
- The valid range is typically between 0 and 1, where 0 means no vertical compression and 1 means maximum hard vertical compression.
- Changes to this variable will affect the final rendered image, particularly in scenes with wide field of view.
Best practices when using this variable include:
- Use it in conjunction with other Panini projection settings (like r.Upscale.Panini.D and r.Upscale.Panini.ScreenFit) for best results.
- Test different values to find the right balance between distortion reduction and image quality for your specific scene.
- Be cautious when setting extreme values, as they may lead to undesirable visual artifacts.
Regarding the associated variable CVarUpscalePaniniS:
- It’s purpose is to provide a programmatic interface to access and modify the r.Upscale.Panini.S setting.
- It’s used within the FPaniniProjectionConfig constructor to retrieve the current value of the setting.
- Developers can use this variable to read or modify the Panini projection’s vertical compression factor at runtime.
- When accessing this variable, use the GetValueOnRenderThread() method to ensure thread-safe access in rendering code.
#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:26
Scope (from outer to inner):
file
namespace anonymous
Source code excerpt:
TAutoConsoleVariable<float> CVarUpscalePaniniS(
TEXT("r.Upscale.Panini.S"),
0,
TEXT("Panini projection's hard vertical compression factor.\n")
TEXT(" 0: no vertical compression factor (default)\n")
TEXT(" 1: Hard vertical compression"),
ECVF_RenderThreadSafe);
#Associated Variable and Callsites
This variable is associated with another variable named CVarUpscalePaniniS
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessUpscale.cpp:25
Scope (from outer to inner):
file
namespace anonymous
Source code excerpt:
ECVF_RenderThreadSafe);
TAutoConsoleVariable<float> CVarUpscalePaniniS(
TEXT("r.Upscale.Panini.S"),
0,
TEXT("Panini projection's hard vertical compression factor.\n")
TEXT(" 0: no vertical compression factor (default)\n")
TEXT(" 1: Hard vertical compression"),
ECVF_RenderThreadSafe);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessUpscale.cpp:74
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)