r.HighResScreenshotDelay
r.HighResScreenshotDelay
#Overview
name: r.HighResScreenshotDelay
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
When high-res screenshots are requested there is a small delay to allow temporal effects to converge.\nDefault: 4. Using a value below the default will disable TemporalAA for improved image quality.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.HighResScreenshotDelay is to control the delay before capturing a high-resolution screenshot in Unreal Engine. This delay allows temporal effects to converge, improving the quality of the final screenshot.
This setting variable is primarily used by the rendering system, specifically in the context of high-resolution screenshot capture. It is referenced in the Engine and Core modules of Unreal Engine.
The value of this variable is set as a console variable with a default value of 4. It can be modified at runtime through the console or programmatically.
The r.HighResScreenshotDelay variable interacts with the TemporalAA (Temporal Anti-Aliasing) setting. If the delay value is set below 4, it will disable TemporalAA for improved image quality in high-resolution screenshots.
Developers should be aware that:
- Lowering the delay value below 4 will disable TemporalAA, which may affect the appearance of the screenshot.
- The delay is measured in frames, with a minimum value of 1.
- This setting affects the performance and visual quality of high-resolution screenshot capture.
Best practices when using this variable include:
- Keep the default value of 4 unless there’s a specific need to change it.
- If disabling TemporalAA is desired for screenshot quality, set the value to 3 or lower.
- Be cautious when setting very high values, as it may introduce unnecessary delays in screenshot capture.
- Consider the trade-off between screenshot quality and capture speed when adjusting this value.
- Test the results with different values to find the optimal setting for your specific use case.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Core/Private/HAL/ConsoleManager.cpp:3711
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarHighResScreenshotDelay(
TEXT("r.HighResScreenshotDelay"),
4,
TEXT("When high-res screenshots are requested there is a small delay to allow temporal effects to converge.\n"
"Default: 4. Using a value below the default will disable TemporalAA for improved image quality."),
ECVF_Default);
static TAutoConsoleVariable<int32> CVarMaterialQualityLevel(
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/ShowFlags.cpp:424
Scope (from outer to inner):
file
function void EngineShowFlagOverride
Source code excerpt:
if (GIsHighResScreenshot)
{
static const auto ICVar = IConsoleManager::Get().FindTConsoleVariableDataInt(TEXT("r.HighResScreenshotDelay"));
if(ICVar->GetValueOnGameThread() < 4)
{
// Disabled as it requires multiple frames, AA can be done by downsampling, more control and better masking
EngineShowFlags.SetTemporalAA(false);
}
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/UnrealClient.cpp:1465
Scope (from outer to inner):
file
function void FViewport::HighResScreenshot
Source code excerpt:
// Render the requested number of frames (at least once)
static const auto HighResScreenshotDelay = IConsoleManager::Get().FindTConsoleVariableDataInt(TEXT("r.HighResScreenshotDelay"));
const uint32 DefaultScreenshotDelay = 4;
uint32 FrameDelay = HighResScreenshotDelay ? FMath::Max(HighResScreenshotDelay->GetValueOnGameThread(), 1) : DefaultScreenshotDelay;
// End the frame that was started before HighResScreenshot() was called. Pass nullptr for the viewport because there's no need to
// call EndRenderFrame on the real viewport, as BeginRenderFrame hasn't been called yet.
HighResScreenshotEndFrame(nullptr);