9#include "Engine/World.h"
15 PrimaryActorTick.bCanEverTick =
false;
22 FilePrefix =
"Data/InstanceSegmentationCamera_";
24 AddPostProcessingMaterial(
"/Game/Agrarsense/Materials/PostProcessingMaterials/M_InstanceSegmentation.M_InstanceSegmentation");
25 Super::Init(parameters, SimulateSensor);
33#ifdef InstanceSegmentationPass_EXISTS
35 UWorld* World = GetWorld();
38 GEngine->Exec(World, TEXT(
"r.EnableSegmentationRendering 1"));
43 SimulatorLog::Log(
"InstanceSegmentationCamera.cpp: This sensor is only supported with our AGRARSENSE fork of the engine.");
50 Super::EndPlay(EndPlayReason);
52#ifdef InstanceSegmentationPass_EXISTS
56 UWorld* World = GetWorld();
59 GEngine->Exec(World, TEXT(
"r.EnableSegmentationRendering 0"));
static int32 InstanceSegmentationCameraCount
void AddPostProcessingMaterial(const FString &Path, float Weight=1.0f)
void ApplyGammaCorrectionLUT(TArray< FColor > &Buffer)
void SetShadowRendering(bool RenderShadows)
virtual void AddProcessingToFrameBuffer(TArray< FColor > &buffer) final override
void Init(FCameraBaseParameters parameters, bool SimulateSensor=true) override
virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) final override
AInstanceSegmentationCamera(const FObjectInitializer &ObjectInitializer)
static void Log(const FString &Message, bool LogToTextFile=true, bool LogToROS=true)