Added "ApproximateActors.RenderDocCapture" cvar

* Makes a scoped render doc capture that encompass the material baking processing of the new "Approximate Actors" merge method.

#ROBOMERGE-SOURCE: CL 16413530 in //UE5/Private-Frosty/...
#ROBOMERGE-BOT: STARSHIP (Private-Frosty -> Main) (v804-16311228)

[CL 16413536 by sebastien lussier in ue5-main branch]
This commit is contained in:
sebastien lussier
2021-05-20 20:54:29 -04:00
parent f808117020
commit fa253204fb
2 changed files with 12 additions and 0 deletions

View File

@@ -51,6 +51,7 @@ public class GeometryProcessingAdapters : ModuleRules
{
"CoreUObject",
"Engine",
"RenderCore",
"MeshBuilder",
"MeshUtilitiesCommon",

View File

@@ -34,12 +34,21 @@
#include "Async/Async.h"
#include "Misc/ScopedSlowTask.h"
#include "RenderCaptureInterface.h"
using namespace UE::Geometry;
using namespace UE::AssetUtils;
#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);
struct FGeneratedResultTextures
{
UTexture2D* BaseColorMap;
@@ -573,6 +582,8 @@ void FApproximateActorsImpl::GenerateApproximationForActorSet(const TArray<AActo
{
TRACE_CPUPROFILER_EVENT_SCOPE(ApproximateActorsImpl_Generate);
RenderCaptureInterface::FScopedCapture RenderCapture(CVarApproximateActorsRDOCCapture.GetValueOnAnyThread() == 1, TEXT("ApproximateActors"));
//
// Future Optimizations
// - can do most of the mesh processing at the same time as capturing the photo set (if that matters)