renderdoc.CaptureDelayInSeconds
renderdoc.CaptureDelayInSeconds
#Overview
name: renderdoc.CaptureDelayInSeconds
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
0 - Capture delay\'s unit is in frames.1 - Capture delay\'s unit is in seconds.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of renderdoc.CaptureDelayInSeconds is to control the unit of measurement for the capture delay in the RenderDoc plugin for Unreal Engine 5. This setting variable is part of the rendering system, specifically for debugging and profiling purposes.
This setting variable is primarily used by the RenderDoc plugin, which is a graphics debugging tool integrated into Unreal Engine. The plugin is located in the Developer category, indicating its use for development and debugging rather than in-game functionality.
The value of this variable is set as a console variable (CVar) in the RenderDocPluginModule.cpp file. It is initialized with a default value of 1, meaning the capture delay is measured in seconds by default.
The renderdoc.CaptureDelayInSeconds variable interacts closely with another variable called renderdoc.CaptureDelay. Together, these variables determine how long the RenderDoc plugin should wait before capturing a frame.
Developers should be aware that:
- When set to 0, the capture delay is measured in frames.
- When set to 1 (default), the capture delay is measured in seconds.
Best practices when using this variable include:
- Adjust this variable in conjunction with renderdoc.CaptureDelay to fine-tune the capture timing.
- Consider the performance impact of frequent captures, especially when capturing the initial state of all rendering resources.
- Use this variable to synchronize captures with specific events in your game or application.
Regarding the associated variable CVarRenderDocCaptureDelayInSeconds:
This is the internal representation of the renderdoc.CaptureDelayInSeconds console variable. It is used within the C++ code to access and modify the value of the setting.
The purpose of CVarRenderDocCaptureDelayInSeconds is to provide a programmatic interface to the renderdoc.CaptureDelayInSeconds setting within the RenderDoc plugin code.
This variable is used in the FRenderDocPluginModule::CaptureFrame function to determine whether the capture delay should be interpreted in seconds or frames. The value is retrieved using the GetValueOnAnyThread() method, which allows for thread-safe access to the variable’s value.
Developers should be aware that changes to CVarRenderDocCaptureDelayInSeconds will directly affect the behavior of the RenderDoc capture functionality. When using this variable in code, always consider the potential impact on performance and capture timing.
Best practices for using CVarRenderDocCaptureDelayInSeconds include:
- Use GetValueOnAnyThread() for thread-safe access to the variable’s value.
- Consider caching the value if it’s accessed frequently to reduce overhead.
- When modifying this variable programmatically, ensure that the new value aligns with the expected behavior of the RenderDoc plugin.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Plugins/Developer/RenderDocPlugin/Source/RenderDocPlugin/Private/RenderDocPluginModule.cpp:57
Scope: file
Source code excerpt:
TEXT("Please note that doing this will significantly increase capture size."));
static TAutoConsoleVariable<int32> CVarRenderDocCaptureDelayInSeconds(
TEXT("renderdoc.CaptureDelayInSeconds"),
1,
TEXT("0 - Capture delay's unit is in frames.")
TEXT("1 - Capture delay's unit is in seconds."));
static TAutoConsoleVariable<int32> CVarRenderDocCaptureDelay(
TEXT("renderdoc.CaptureDelay"),
0,
#Associated Variable and Callsites
This variable is associated with another variable named CVarRenderDocCaptureDelayInSeconds
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Plugins/Developer/RenderDocPlugin/Source/RenderDocPlugin/Private/RenderDocPluginModule.cpp:56
Scope: file
Source code excerpt:
TEXT("1 - Always capture the initial state of all rendering resources. ")
TEXT("Please note that doing this will significantly increase capture size."));
static TAutoConsoleVariable<int32> CVarRenderDocCaptureDelayInSeconds(
TEXT("renderdoc.CaptureDelayInSeconds"),
1,
TEXT("0 - Capture delay's unit is in frames.")
TEXT("1 - Capture delay's unit is in seconds."));
static TAutoConsoleVariable<int32> CVarRenderDocCaptureDelay(
TEXT("renderdoc.CaptureDelay"),
#Loc: <Workspace>/Engine/Plugins/Developer/RenderDocPlugin/Source/RenderDocPlugin/Private/RenderDocPluginModule.cpp:427
Scope (from outer to inner):
file
function void FRenderDocPluginModule::CaptureFrame
Source code excerpt:
// store all CVars at beginning of capture in case they change while the capture is occurring :
CaptureFrameCount = CVarRenderDocCaptureFrameCount.GetValueOnAnyThread();
bCaptureDelayInSeconds = CVarRenderDocCaptureDelayInSeconds.GetValueOnAnyThread() > 0;
if (bCaptureDelayInSeconds)
{
DelayedCaptureSeconds = FPlatformTime::Seconds() + (double)FrameDelay;
}
else