Move CaptureScene to PostPhysTick for ASceneCaptureSensors.
This commit is contained in:
parent
5e1d6e4ed2
commit
5a2eadd161
|
@ -136,7 +136,6 @@ void ADVSCamera::PostPhysTick(UWorld *World, ELevelTick TickType, float DeltaTim
|
|||
}
|
||||
|
||||
/// Immediate enqueues render commands of the scene at the current time.
|
||||
EnqueueRenderSceneImmediate();
|
||||
WaitForRenderThreadToFinish();
|
||||
|
||||
//Super (ASceneCaptureSensor) Capture the Scene in a (UTextureRenderTarget2D) CaptureRenderTarge from the CaptureComponent2D
|
||||
|
|
|
@ -34,7 +34,6 @@ void ADepthCamera::PostPhysTick(UWorld *World, ELevelTick TickType, float DeltaS
|
|||
{
|
||||
TRACE_CPUPROFILER_EVENT_SCOPE(ADepthCamera::PostPhysTick);
|
||||
|
||||
EnqueueRenderSceneImmediate();
|
||||
ImageUtil::ReadSensorImageDataAsyncFColor(*this, [this](
|
||||
TArrayView<const FColor> Pixels,
|
||||
FIntPoint Size) -> bool
|
||||
|
|
|
@ -63,7 +63,6 @@ void AInstanceSegmentationCamera::PostPhysTick(UWorld *World, ELevelTick TickTyp
|
|||
SceneCapture->ShowOnlyComponents.Emplace(Component);
|
||||
}
|
||||
|
||||
EnqueueRenderSceneImmediate();
|
||||
ImageUtil::ReadSensorImageDataAsyncFColor(*this, [this](
|
||||
TArrayView<const FColor> Pixels,
|
||||
FIntPoint Size) -> bool
|
||||
|
|
|
@ -28,7 +28,6 @@ void ANormalsCamera::PostPhysTick(UWorld *World, ELevelTick TickType, float Delt
|
|||
{
|
||||
TRACE_CPUPROFILER_EVENT_SCOPE(ANormalsCamera::PostPhysTick);
|
||||
|
||||
EnqueueRenderSceneImmediate();
|
||||
ImageUtil::ReadSensorImageDataAsyncFColor(*this, [this](
|
||||
TArrayView<const FColor> Pixels,
|
||||
FIntPoint Size) -> bool
|
||||
|
|
|
@ -63,7 +63,6 @@ void ASceneCaptureCamera::PostPhysTick(UWorld *World, ELevelTick TickType, float
|
|||
}
|
||||
);
|
||||
|
||||
EnqueueRenderSceneImmediate();
|
||||
ImageUtil::ReadSensorImageDataAsyncFColor(*this, [this](
|
||||
TArrayView<const FColor> Pixels,
|
||||
FIntPoint Size) -> bool
|
||||
|
|
|
@ -516,6 +516,7 @@ void ASceneCaptureSensor::PrePhysTick(float DeltaSeconds)
|
|||
void ASceneCaptureSensor::PostPhysTick(UWorld *World, ELevelTick TickType, float DeltaTime)
|
||||
{
|
||||
Super::PostPhysTick(World, TickType, DeltaTime);
|
||||
EnqueueRenderSceneImmediate();
|
||||
}
|
||||
|
||||
void ASceneCaptureSensor::EndPlay(const EEndPlayReason::Type EndPlayReason)
|
||||
|
|
|
@ -28,7 +28,6 @@ void ASemanticSegmentationCamera::PostPhysTick(UWorld *World, ELevelTick TickTyp
|
|||
{
|
||||
TRACE_CPUPROFILER_EVENT_SCOPE(ASemanticSegmentationCamera::PostPhysTick);
|
||||
|
||||
EnqueueRenderSceneImmediate();
|
||||
ImageUtil::ReadSensorImageDataAsyncFColor(*this, [this](
|
||||
TArrayView<const FColor> Pixels,
|
||||
FIntPoint Size) -> bool
|
||||
|
|
|
@ -234,7 +234,7 @@ void ASensorSpawnerActor::SaveSensorData(float DeltaSeconds)
|
|||
if(ASceneCaptureSensor* CaptureSensor = Cast<ASceneCaptureSensor>(CurrentSensor))
|
||||
{
|
||||
const FString FinalPath = FPaths::Combine(SaveImagePath, CaptureSensor->GetName(), FString::Printf(TEXT("%lld"), FDateTime::Now().ToUnixTimestamp()) + "-Frame_" + FrameNumber + ".png");
|
||||
CaptureSensor->EnqueueRenderSceneImmediate();
|
||||
// CaptureSensor->EnqueueRenderSceneImmediate();
|
||||
CaptureSensor->SaveCaptureToDisk(FinalPath);
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue