r.Upscale.Panini.ScreenFit
r.Upscale.Panini.ScreenFit
#Overview
name: r.Upscale.Panini.ScreenFit
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Panini projection screen fit effect factor (lerp).\n 0: fit vertically\n 1: fit horizontally (default)
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:
- Consider the aspect ratio of your target displays when adjusting this value.
- Test the visual results with different values to find the best fit for your specific use case.
- Be cautious when changing this value at runtime, as it may cause noticeable shifts in the rendered image.
Regarding the associated variable CVarUpscalePaniniScreenFit:
- Its purpose is to provide a programmatic interface to access and modify the r.Upscale.Panini.ScreenFit value.
- It’s used in the Renderer module, specifically in the FPaniniProjectionConfig constructor.
- The value is set through the CVar system and can be accessed using GetValueOnRenderThread() method.
- It interacts directly with r.Upscale.Panini.ScreenFit, effectively controlling the same setting.
- Developers should be aware that changes to this variable will affect the Panini projection’s screen fit in real-time.
- Best practices include using this variable for runtime adjustments of the Panini projection screen fit, and ensuring that any modifications are thread-safe, as indicated by the ECVF_RenderThreadSafe flag.
#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)