r.RenderLastFrameInStreamingPause
r.RenderLastFrameInStreamingPause
#Overview
name: r.RenderLastFrameInStreamingPause
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
If 1 the previous frame is displayed during streaming pause. If zero the screen is left black.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.RenderLastFrameInStreamingPause is to control whether the previous frame is displayed during streaming pause or if the screen is left black. This setting is part of the streaming and rendering system in Unreal Engine 5.
This setting variable is primarily used by the StreamingPauseRendering module, which is responsible for handling the rendering behavior during streaming pauses. It’s particularly relevant for managing visual feedback during loading or streaming operations.
The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of 1, meaning that by default, the previous frame is displayed during a streaming pause.
The associated variable CVarRenderLastFrameInStreamingPause directly interacts with r.RenderLastFrameInStreamingPause. They share the same value and purpose.
Developers must be aware that:
- This setting affects the user experience during loading or streaming operations.
- It has implications for both regular and stereoscopic rendering scenarios.
- The setting is render thread safe, meaning it can be changed without causing threading issues.
Best practices when using this variable include:
- Consider the target platform and hardware capabilities when deciding whether to render the last frame or show a black screen.
- Be mindful of potential performance implications, especially on lower-end devices.
- Use this in conjunction with other streaming and rendering settings for a cohesive loading experience.
Regarding the associated variable CVarRenderLastFrameInStreamingPause:
- It’s a TAutoConsoleVariable
, which means it’s an integer console variable that can be changed at runtime. - It’s used to retrieve the current value of the setting in the code, specifically in the BeginStreamingPause function of the FStreamingPauseRenderingModule.
- The value is checked on the game thread (GetValueOnGameThread()), which is important for thread safety considerations.
- It’s used in conjunction with other checks, such as whether stereoscopic rendering is allowed, to determine the final rendering behavior during streaming pause.
Developers should be aware that changing this console variable at runtime will immediately affect the streaming pause rendering behavior, which can be useful for debugging or adjusting the user experience on the fly.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/StreamingPauseRendering/Private/StreamingPauseRendering.cpp:57
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarRenderLastFrameInStreamingPause(
TEXT("r.RenderLastFrameInStreamingPause"),
1,
TEXT("If 1 the previous frame is displayed during streaming pause. If zero the screen is left black."),
ECVF_RenderThreadSafe);
FStreamingPauseRenderingModule::FStreamingPauseRenderingModule()
#Associated Variable and Callsites
This variable is associated with another variable named CVarRenderLastFrameInStreamingPause
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/StreamingPauseRendering/Private/StreamingPauseRendering.cpp:56
Scope: file
Source code excerpt:
};
static TAutoConsoleVariable<int32> CVarRenderLastFrameInStreamingPause(
TEXT("r.RenderLastFrameInStreamingPause"),
1,
TEXT("If 1 the previous frame is displayed during streaming pause. If zero the screen is left black."),
ECVF_RenderThreadSafe);
#Loc: <Workspace>/Engine/Source/Runtime/StreamingPauseRendering/Private/StreamingPauseRendering.cpp:120
Scope (from outer to inner):
file
function void FStreamingPauseRenderingModule::BeginStreamingPause
Source code excerpt:
//Render the current scene to a new viewport.
FIntPoint SizeXY = GameViewport->GetSizeXY();
bool bRenderLastFrame = CVarRenderLastFrameInStreamingPause.GetValueOnGameThread() != 0;
bRenderLastFrame = bRenderLastFrame && !(GEngine->StereoRenderingDevice.IsValid() && GameViewport->IsStereoRenderingAllowed());
if(SizeXY.X > 0 && SizeXY.Y > 0 && bRenderLastFrame)
{
FViewportClient* ViewportClient = GameViewport->GetClient();