ApproximateActors.RenderCapture
ApproximateActors.RenderCapture
#Overview
name: ApproximateActors.RenderCapture
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Determines whether or not to trigger a render capture.\n0: Turned Off\n1: Turned On
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of ApproximateActors.RenderCapture is to control whether a render capture is triggered during the actor approximation process in Unreal Engine 5. This setting is primarily used for debugging and performance analysis purposes.
This setting variable is used within the Experimental MeshModelingToolsetExp plugin, specifically in the GeometryProcessingAdapters module. It’s part of the actor approximation system, which is likely used for Level of Detail (LOD) generation or mesh simplification.
The value of this variable is set through a console variable (CVar) named CVarApproximateActorsRDOCCapture. It’s initialized with a default value of 0, meaning the render capture is turned off by default. The value can be changed at runtime through the console or programmatically.
The associated variable CVarApproximateActorsRDOCCapture directly interacts with ApproximateActors.RenderCapture. They share the same value and purpose.
Developers must be aware that:
- This is an experimental feature, as it’s part of an experimental plugin.
- Enabling this feature (setting the value to 1) may impact performance, as it triggers render captures.
- This feature is primarily intended for debugging and analysis, not for use in production builds.
Best practices when using this variable include:
- Only enable it when necessary for debugging or performance analysis.
- Be cautious about using it in production environments due to potential performance impacts.
- Remember to disable it after debugging to avoid unnecessary overhead.
Regarding the associated variable CVarApproximateActorsRDOCCapture:
- It’s a TAutoConsoleVariable
, which means it’s an integer console variable that can be changed at runtime. - It’s used to determine whether to trigger a render capture during the GenerateApproximationForActorSet function.
- The value is retrieved using GetValueOnAnyThread(), suggesting it can be accessed from multiple threads.
- It’s used in conjunction with RenderCaptureInterface::FScopedCapture, indicating it’s part of a render capture system, likely for debugging or profiling purposes.
When working with this variable, developers should ensure they understand the performance implications of enabling render captures and use it judiciously in their development process.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Plugins/Experimental/MeshModelingToolsetExp/Source/GeometryProcessingAdapters/Private/ApproximateActorsImpl.cpp:55
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarApproximateActorsRDOCCapture(
TEXT("ApproximateActors.RenderCapture"),
0,
TEXT("Determines whether or not to trigger a render capture.\n")
TEXT("0: Turned Off\n")
TEXT("1: Turned On"),
ECVF_Default);
#Associated Variable and Callsites
This variable is associated with another variable named CVarApproximateActorsRDOCCapture
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Plugins/Experimental/MeshModelingToolsetExp/Source/GeometryProcessingAdapters/Private/ApproximateActorsImpl.cpp:54
Scope: file
Source code excerpt:
#define LOCTEXT_NAMESPACE "ApproximateActorsImpl"
static TAutoConsoleVariable<int32> CVarApproximateActorsRDOCCapture(
TEXT("ApproximateActors.RenderCapture"),
0,
TEXT("Determines whether or not to trigger a render capture.\n")
TEXT("0: Turned Off\n")
TEXT("1: Turned On"),
ECVF_Default);
#Loc: <Workspace>/Engine/Plugins/Experimental/MeshModelingToolsetExp/Source/GeometryProcessingAdapters/Private/ApproximateActorsImpl.cpp:1054
Scope (from outer to inner):
file
function void FApproximateActorsImpl::GenerateApproximationForActorSet
Source code excerpt:
TRACE_CPUPROFILER_EVENT_SCOPE(ApproximateActorsImpl_Generate);
RenderCaptureInterface::FScopedCapture RenderCapture(CVarApproximateActorsRDOCCapture.GetValueOnAnyThread() == 1, TEXT("ApproximateActors"));
if (Options.BasePolicy == IGeometryProcessing_ApproximateActors::EApproximationPolicy::MeshAndGeneratedMaterial)
{
// The scene capture photoset part of this process relies on debug view modes being available.
// If it ain't the case, fail immediatelly
if (!AllowDebugViewmodes())