CARLA
SceneCaptureSensor.cpp
Go to the documentation of this file.
1 // Copyright (c) 2017 Computer Vision Center (CVC) at the Universitat Autonoma
2 // de Barcelona (UAB).
3 //
4 // This work is licensed under the terms of the MIT license.
5 // For a copy, see <https://opensource.org/licenses/MIT>.
6 
7 #include "Carla.h"
9 
11 
12 #include "Async/Async.h"
13 #include "Components/DrawFrustumComponent.h"
14 #include "Components/SceneCaptureComponent2D.h"
15 #include "Components/StaticMeshComponent.h"
16 #include "ContentStreaming.h"
17 #include "Engine/Classes/Engine/Scene.h"
18 #include "Engine/TextureRenderTarget2D.h"
19 #include "HAL/UnrealMemory.h"
20 #include "HighResScreenshot.h"
21 #include "Misc/CoreDelegates.h"
22 #include "RHICommandList.h"
23 
24 static auto SCENE_CAPTURE_COUNTER = 0u;
25 
26 // =============================================================================
27 // -- Local static methods -----------------------------------------------------
28 // =============================================================================
29 
30 // Local namespace to avoid name collisions on unit builds.
32 
33  static void SetCameraDefaultOverrides(USceneCaptureComponent2D &CaptureComponent2D);
34 
35  static void ConfigureShowFlags(FEngineShowFlags &ShowFlags, bool bPostProcessing = true);
36 
37  static auto GetQualitySettings(UWorld *World)
38  {
39  auto Settings = UCarlaStatics::GetCarlaSettings(World);
40  check(Settings != nullptr);
41  return Settings->GetQualityLevel();
42  }
43 
44 } // namespace SceneCaptureSensor_local_ns
45 
46 // =============================================================================
47 // -- ASceneCaptureSensor ------------------------------------------------------
48 // =============================================================================
49 
50 ASceneCaptureSensor::ASceneCaptureSensor(const FObjectInitializer &ObjectInitializer)
51  : Super(ObjectInitializer)
52 {
53  PrimaryActorTick.bCanEverTick = true;
54  PrimaryActorTick.TickGroup = TG_PrePhysics;
55 
56  CaptureRenderTarget = CreateDefaultSubobject<UTextureRenderTarget2D>(
57  FName(*FString::Printf(TEXT("CaptureRenderTarget_d%d"), SCENE_CAPTURE_COUNTER)));
58  CaptureRenderTarget->CompressionSettings = TextureCompressionSettings::TC_Default;
59  CaptureRenderTarget->SRGB = false;
60  CaptureRenderTarget->bAutoGenerateMips = false;
61  CaptureRenderTarget->bGPUSharedFlag = true;
62  CaptureRenderTarget->AddressX = TextureAddress::TA_Clamp;
63  CaptureRenderTarget->AddressY = TextureAddress::TA_Clamp;
64 
65  CaptureComponent2D = CreateDefaultSubobject<USceneCaptureComponent2D>(
66  FName(*FString::Printf(TEXT("SceneCaptureComponent2D_%d"), SCENE_CAPTURE_COUNTER)));
67  CaptureComponent2D->SetupAttachment(RootComponent);
68  CaptureComponent2D->PrimitiveRenderMode = ESceneCapturePrimitiveRenderMode::PRM_RenderScenePrimitives;
69 
70  CaptureComponent2D->bCaptureOnMovement = false;
71  CaptureComponent2D->bCaptureEveryFrame = false;
72  CaptureComponent2D->bAlwaysPersistRenderingState = true;
73 
75 
77 }
78 
80 {
81  Super::Set(Description);
83 }
84 
85 void ASceneCaptureSensor::SetImageSize(uint32 InWidth, uint32 InHeight)
86 {
87  ImageWidth = InWidth;
88  ImageHeight = InHeight;
89 }
90 
91 void ASceneCaptureSensor::SetFOVAngle(const float FOVAngle)
92 {
93  check(CaptureComponent2D != nullptr);
94  CaptureComponent2D->FOVAngle = FOVAngle;
95 }
96 
98 {
99  check(CaptureComponent2D != nullptr);
100  return CaptureComponent2D->FOVAngle;
101 }
102 
103 void ASceneCaptureSensor::SetExposureMethod(EAutoExposureMethod Method)
104 {
105  check(CaptureComponent2D != nullptr);
106  CaptureComponent2D->PostProcessSettings.AutoExposureMethod = Method;
107 }
108 
109 EAutoExposureMethod ASceneCaptureSensor::GetExposureMethod() const
110 {
111  check(CaptureComponent2D != nullptr);
112  return CaptureComponent2D->PostProcessSettings.AutoExposureMethod;
113 }
114 
116 {
117  check(CaptureComponent2D != nullptr);
118 #if PLATFORM_LINUX
119  // Looks like Windows and Linux have different outputs with the
120  // same exposure compensation, this fixes it.
121  CaptureComponent2D->PostProcessSettings.AutoExposureBias = Compensation + 0.75f;
122 #else
123  CaptureComponent2D->PostProcessSettings.AutoExposureBias = Compensation;
124 #endif
125 }
126 
128 {
129  check(CaptureComponent2D != nullptr);
130  return CaptureComponent2D->PostProcessSettings.AutoExposureBias;
131 }
132 
134 {
135  check(CaptureComponent2D != nullptr);
136  CaptureComponent2D->PostProcessSettings.CameraShutterSpeed = Speed;
137 }
138 
140 {
141  check(CaptureComponent2D != nullptr);
142  return CaptureComponent2D->PostProcessSettings.CameraShutterSpeed;
143 }
144 
146 {
147  check(CaptureComponent2D != nullptr);
148  CaptureComponent2D->PostProcessSettings.CameraISO = ISO;
149 }
150 
152 {
153  check(CaptureComponent2D != nullptr);
154  return CaptureComponent2D->PostProcessSettings.CameraISO;
155 }
156 
158 {
159  check(CaptureComponent2D != nullptr);
160  CaptureComponent2D->PostProcessSettings.DepthOfFieldFstop = Aperture;
161 }
162 
164 {
165  check(CaptureComponent2D != nullptr);
166  return CaptureComponent2D->PostProcessSettings.DepthOfFieldFstop;
167 }
168 
170 {
171  check(CaptureComponent2D != nullptr);
172  CaptureComponent2D->PostProcessSettings.DepthOfFieldFocalDistance = Distance;
173 }
174 
176 {
177  check(CaptureComponent2D != nullptr);
178  return CaptureComponent2D->PostProcessSettings.DepthOfFieldFocalDistance;
179 }
180 
182 {
183  check(CaptureComponent2D != nullptr);
184  CaptureComponent2D->PostProcessSettings.DepthOfFieldDepthBlurAmount = Amount;
185 }
186 
188 {
189  check(CaptureComponent2D != nullptr);
190  return CaptureComponent2D->PostProcessSettings.DepthOfFieldDepthBlurAmount;
191 }
192 
194 {
195  check(CaptureComponent2D != nullptr);
196  CaptureComponent2D->PostProcessSettings.DepthOfFieldDepthBlurRadius = Radius;
197 }
198 
200 {
201  check(CaptureComponent2D != nullptr);
202  return CaptureComponent2D->PostProcessSettings.DepthOfFieldDepthBlurRadius;
203 }
204 
206 {
207  check(CaptureComponent2D != nullptr);
208  CaptureComponent2D->PostProcessSettings.DepthOfFieldMinFstop = MinFstop;
209 }
210 
212 {
213  check(CaptureComponent2D != nullptr);
214  return CaptureComponent2D->PostProcessSettings.DepthOfFieldMinFstop;
215 }
216 
218 {
219  check(CaptureComponent2D != nullptr);
220  CaptureComponent2D->PostProcessSettings.DepthOfFieldBladeCount = Count;
221 }
222 
224 {
225  check(CaptureComponent2D != nullptr);
226  return CaptureComponent2D->PostProcessSettings.DepthOfFieldBladeCount;
227 }
228 
230 {
231  check(CaptureComponent2D != nullptr);
232  CaptureComponent2D->PostProcessSettings.FilmSlope = Slope;
233 }
234 
236 {
237  check(CaptureComponent2D != nullptr);
238  return CaptureComponent2D->PostProcessSettings.FilmSlope;
239 }
240 
242 {
243  check(CaptureComponent2D != nullptr);
244  CaptureComponent2D->PostProcessSettings.FilmToe = Toe; // FilmToeAmount?
245 }
246 
248 {
249  check(CaptureComponent2D != nullptr);
250  return CaptureComponent2D->PostProcessSettings.FilmToe;
251 }
252 
254 {
255  check(CaptureComponent2D != nullptr);
256  CaptureComponent2D->PostProcessSettings.FilmShoulder = Shoulder;
257 }
258 
260 {
261  check(CaptureComponent2D != nullptr);
262  return CaptureComponent2D->PostProcessSettings.FilmShoulder;
263 }
264 
266 {
267  check(CaptureComponent2D != nullptr);
268  CaptureComponent2D->PostProcessSettings.FilmBlackClip = BlackClip;
269 }
270 
272 {
273  check(CaptureComponent2D != nullptr);
274  return CaptureComponent2D->PostProcessSettings.FilmBlackClip;
275 }
276 
278 {
279  check(CaptureComponent2D != nullptr);
280  CaptureComponent2D->PostProcessSettings.FilmWhiteClip = WhiteClip;
281 }
282 
284 {
285  check(CaptureComponent2D != nullptr);
286  return CaptureComponent2D->PostProcessSettings.FilmWhiteClip;
287 }
288 
290 {
291  check(CaptureComponent2D != nullptr);
292  CaptureComponent2D->PostProcessSettings.AutoExposureMinBrightness = Brightness;
293 }
294 
296 {
297  check(CaptureComponent2D != nullptr);
298  return CaptureComponent2D->PostProcessSettings.AutoExposureMinBrightness;
299 }
300 
302 {
303  check(CaptureComponent2D != nullptr);
304  CaptureComponent2D->PostProcessSettings.AutoExposureMaxBrightness = Brightness;
305 }
306 
308 {
309  check(CaptureComponent2D != nullptr);
310  return CaptureComponent2D->PostProcessSettings.AutoExposureMaxBrightness;
311 }
312 
314 {
315  check(CaptureComponent2D != nullptr);
316  CaptureComponent2D->PostProcessSettings.AutoExposureSpeedDown = Speed;
317 }
318 
320 {
321  check(CaptureComponent2D != nullptr);
322  return CaptureComponent2D->PostProcessSettings.AutoExposureSpeedDown;
323 }
324 
326 {
327  check(CaptureComponent2D != nullptr);
328  CaptureComponent2D->PostProcessSettings.AutoExposureSpeedUp = Speed;
329 }
330 
332 {
333  check(CaptureComponent2D != nullptr);
334  return CaptureComponent2D->PostProcessSettings.AutoExposureSpeedUp;
335 }
336 
338 {
339  check(CaptureComponent2D != nullptr);
340  CaptureComponent2D->PostProcessSettings.AutoExposureCalibrationConstant_DEPRECATED = Constant;
341 }
342 
344 {
345  check(CaptureComponent2D != nullptr);
346  return CaptureComponent2D->PostProcessSettings.AutoExposureCalibrationConstant_DEPRECATED;
347 }
348 
350 {
351  check(CaptureComponent2D != nullptr);
352  CaptureComponent2D->PostProcessSettings.MotionBlurAmount = Intensity;
353 }
354 
356 {
357  check(CaptureComponent2D != nullptr);
358  return CaptureComponent2D->PostProcessSettings.MotionBlurAmount;
359 }
360 
362 {
363  check(CaptureComponent2D != nullptr);
364  CaptureComponent2D->PostProcessSettings.MotionBlurMax = MaxDistortion;
365 }
366 
368 {
369  check(CaptureComponent2D != nullptr);
370  return CaptureComponent2D->PostProcessSettings.MotionBlurMax;
371 }
372 
374 {
375  check(CaptureComponent2D != nullptr);
376  CaptureComponent2D->PostProcessSettings.MotionBlurPerObjectSize = ScreenSize;
377 }
378 
380 {
381  check(CaptureComponent2D != nullptr);
382  return CaptureComponent2D->PostProcessSettings.MotionBlurPerObjectSize;
383 }
384 
386 {
387  check(CaptureComponent2D != nullptr);
388  CaptureComponent2D->PostProcessSettings.LensFlareIntensity = Intensity;
389 }
390 
392 {
393  check(CaptureComponent2D != nullptr);
394  return CaptureComponent2D->PostProcessSettings.LensFlareIntensity;
395 }
396 
398 {
399  check(CaptureComponent2D != nullptr);
400  CaptureComponent2D->PostProcessSettings.BloomIntensity = Intensity;
401 }
402 
404 {
405  check(CaptureComponent2D != nullptr);
406  return CaptureComponent2D->PostProcessSettings.BloomIntensity;
407 }
408 
410 {
411  check(CaptureComponent2D != nullptr);
412  CaptureComponent2D->PostProcessSettings.WhiteTemp = Temp;
413 }
414 
416 {
417  check(CaptureComponent2D != nullptr);
418  return CaptureComponent2D->PostProcessSettings.WhiteTemp;
419 }
420 
422 {
423  check(CaptureComponent2D != nullptr);
424  CaptureComponent2D->PostProcessSettings.WhiteTint = Tint;
425 }
426 
428 {
429  check(CaptureComponent2D != nullptr);
430  return CaptureComponent2D->PostProcessSettings.WhiteTint;
431 }
432 
434 {
435  check(CaptureComponent2D != nullptr);
436  CaptureComponent2D->PostProcessSettings.SceneFringeIntensity = Intensity;
437 }
438 
440 {
441  check(CaptureComponent2D != nullptr);
442  return CaptureComponent2D->PostProcessSettings.SceneFringeIntensity;
443 }
444 
445 void ASceneCaptureSensor::SetChromAberrOffset(float ChromAberrOffset)
446 {
447  check(CaptureComponent2D != nullptr);
448  CaptureComponent2D->PostProcessSettings.ChromaticAberrationStartOffset = ChromAberrOffset;
449 }
450 
452 {
453  check(CaptureComponent2D != nullptr);
454  return CaptureComponent2D->PostProcessSettings.ChromaticAberrationStartOffset;
455 }
456 
458  TRACE_CPUPROFILER_EVENT_SCOPE(ASceneCaptureSensor::EnqueueRenderSceneImmediate);
459  // Creates an snapshot of the scene, requieres bCaptureEveryFrame = false.
460  CaptureComponent2D->CaptureScene();
461 }
462 
464 {
465  using namespace SceneCaptureSensor_local_ns;
466 
467  // Determine the gamma of the player.
468  const bool bInForceLinearGamma = !bEnablePostProcessingEffects;
469 
470  CaptureRenderTarget->InitCustomFormat(ImageWidth, ImageHeight, bEnable16BitFormat ? PF_FloatRGBA : PF_B8G8R8A8,
471  bInForceLinearGamma);
472 
474  {
475  CaptureRenderTarget->TargetGamma = TargetGamma;
476  }
477 
478  check(IsValid(CaptureComponent2D) && !CaptureComponent2D->IsPendingKill());
479 
480  CaptureComponent2D->Deactivate();
481  CaptureComponent2D->TextureTarget = CaptureRenderTarget;
482 
483  // Call derived classes to set up their things.
485 
486  CaptureComponent2D->CaptureSource = ESceneCaptureSource::SCS_FinalColorLDR;
487 
488  CaptureComponent2D->UpdateContent();
489  CaptureComponent2D->Activate();
490 
491  // Make sure that there is enough time in the render queue.
492  UKismetSystemLibrary::ExecuteConsoleCommand(
493  GetWorld(),
494  FString("g.TimeoutForBlockOnRenderFence 300000"));
495 
498 
499  // This ensures the camera is always spawning the raindrops in case the
500  // weather was previously set to have rain.
502 
503  Super::BeginPlay();
504 }
505 
506 void ASceneCaptureSensor::PrePhysTick(float DeltaSeconds)
507 {
508  Super::PrePhysTick(DeltaSeconds);
509 
510  // Add the view information every tick. It's only used for one tick and then
511  // removed by the streamer.
512  IStreamingManager::Get().AddViewInformation(
513  CaptureComponent2D->GetComponentLocation(),
514  ImageWidth,
515  ImageWidth / FMath::Tan(CaptureComponent2D->FOVAngle));
516 }
517 
518 void ASceneCaptureSensor::PostPhysTick(UWorld *World, ELevelTick TickType, float DeltaTime)
519 {
520  Super::PostPhysTick(World, TickType, DeltaTime);
521 }
522 
523 void ASceneCaptureSensor::EndPlay(const EEndPlayReason::Type EndPlayReason)
524 {
525  Super::EndPlay(EndPlayReason);
527 }
528 
529 // =============================================================================
530 // -- Local static functions implementations -----------------------------------
531 // =============================================================================
532 
533 namespace SceneCaptureSensor_local_ns {
534 
535  static void SetCameraDefaultOverrides(USceneCaptureComponent2D &CaptureComponent2D)
536  {
537  auto &PostProcessSettings = CaptureComponent2D.PostProcessSettings;
538 
539  // Exposure
540  PostProcessSettings.bOverride_AutoExposureMethod = true;
541  PostProcessSettings.AutoExposureMethod = EAutoExposureMethod::AEM_Histogram;
542  PostProcessSettings.bOverride_AutoExposureBias = true;
543  PostProcessSettings.bOverride_AutoExposureMinBrightness = true;
544  PostProcessSettings.bOverride_AutoExposureMaxBrightness = true;
545  PostProcessSettings.bOverride_AutoExposureSpeedUp = true;
546  PostProcessSettings.bOverride_AutoExposureSpeedDown = true;
547  PostProcessSettings.bOverride_AutoExposureCalibrationConstant_DEPRECATED = true;
548  PostProcessSettings.bOverride_HistogramLogMin = true;
549  PostProcessSettings.HistogramLogMin = 1.0f;
550  PostProcessSettings.bOverride_HistogramLogMax = true;
551  PostProcessSettings.HistogramLogMax = 12.0f;
552 
553  // Camera
554  PostProcessSettings.bOverride_CameraShutterSpeed = true;
555  PostProcessSettings.bOverride_CameraISO = true;
556  PostProcessSettings.bOverride_DepthOfFieldFstop = true;
557  PostProcessSettings.bOverride_DepthOfFieldMinFstop = true;
558  PostProcessSettings.bOverride_DepthOfFieldBladeCount = true;
559 
560  // Film (Tonemapper)
561  PostProcessSettings.bOverride_FilmSlope = true;
562  PostProcessSettings.bOverride_FilmToe = true;
563  PostProcessSettings.bOverride_FilmShoulder = true;
564  PostProcessSettings.bOverride_FilmWhiteClip = true;
565  PostProcessSettings.bOverride_FilmBlackClip = true;
566 
567  // Motion blur
568  PostProcessSettings.bOverride_MotionBlurAmount = true;
569  PostProcessSettings.MotionBlurAmount = 0.45f;
570  PostProcessSettings.bOverride_MotionBlurMax = true;
571  PostProcessSettings.MotionBlurMax = 0.35f;
572  PostProcessSettings.bOverride_MotionBlurPerObjectSize = true;
573  PostProcessSettings.MotionBlurPerObjectSize = 0.1f;
574 
575  // Color Grading
576  PostProcessSettings.bOverride_WhiteTemp = true;
577  PostProcessSettings.bOverride_WhiteTint = true;
578  PostProcessSettings.bOverride_ColorContrast = true;
579 #if PLATFORM_LINUX
580  // Looks like Windows and Linux have different outputs with the
581  // same exposure compensation, this fixes it.
582  PostProcessSettings.ColorContrast = FVector4(1.2f, 1.2f, 1.2f, 1.0f);
583 #endif
584 
585  // Chromatic Aberration
586  PostProcessSettings.bOverride_SceneFringeIntensity = true;
587  PostProcessSettings.bOverride_ChromaticAberrationStartOffset = true;
588 
589  // Ambient Occlusion
590  PostProcessSettings.bOverride_AmbientOcclusionIntensity = true;
591  PostProcessSettings.AmbientOcclusionIntensity = 0.5f;
592  PostProcessSettings.bOverride_AmbientOcclusionRadius = true;
593  PostProcessSettings.AmbientOcclusionRadius = 100.0f;
594  PostProcessSettings.bOverride_AmbientOcclusionStaticFraction = true;
595  PostProcessSettings.AmbientOcclusionStaticFraction = 1.0f;
596  PostProcessSettings.bOverride_AmbientOcclusionFadeDistance = true;
597  PostProcessSettings.AmbientOcclusionFadeDistance = 50000.0f;
598  PostProcessSettings.bOverride_AmbientOcclusionPower = true;
599  PostProcessSettings.AmbientOcclusionPower = 2.0f;
600  PostProcessSettings.bOverride_AmbientOcclusionBias = true;
601  PostProcessSettings.AmbientOcclusionBias = 3.0f;
602  PostProcessSettings.bOverride_AmbientOcclusionQuality = true;
603  PostProcessSettings.AmbientOcclusionQuality = 100.0f;
604 
605  // Bloom
606  PostProcessSettings.bOverride_BloomMethod = true;
607  PostProcessSettings.BloomMethod = EBloomMethod::BM_SOG;
608  PostProcessSettings.bOverride_BloomIntensity = true;
609  PostProcessSettings.BloomIntensity = 0.675f;
610  PostProcessSettings.bOverride_BloomThreshold = true;
611  PostProcessSettings.BloomThreshold = -1.0f;
612 
613  // Lens
614  PostProcessSettings.bOverride_LensFlareIntensity = true;
615  PostProcessSettings.LensFlareIntensity = 0.1;
616  }
617 
618  // Remove the show flags that might interfere with post-processing effects
619  // like depth and semantic segmentation.
620  static void ConfigureShowFlags(FEngineShowFlags &ShowFlags, bool bPostProcessing)
621  {
622  if (bPostProcessing)
623  {
624  ShowFlags.EnableAdvancedFeatures();
625  ShowFlags.SetMotionBlur(true);
626  return;
627  }
628 
629  ShowFlags.SetAmbientOcclusion(false);
630  ShowFlags.SetAntiAliasing(false);
631  ShowFlags.SetVolumetricFog(false);
632  // ShowFlags.SetAtmosphericFog(false);
633  // ShowFlags.SetAudioRadius(false);
634  // ShowFlags.SetBillboardSprites(false);
635  ShowFlags.SetBloom(false);
636  // ShowFlags.SetBounds(false);
637  // ShowFlags.SetBrushes(false);
638  // ShowFlags.SetBSP(false);
639  // ShowFlags.SetBSPSplit(false);
640  // ShowFlags.SetBSPTriangles(false);
641  // ShowFlags.SetBuilderBrush(false);
642  // ShowFlags.SetCameraAspectRatioBars(false);
643  // ShowFlags.SetCameraFrustums(false);
644  ShowFlags.SetCameraImperfections(false);
645  ShowFlags.SetCameraInterpolation(false);
646  // ShowFlags.SetCameraSafeFrames(false);
647  // ShowFlags.SetCollision(false);
648  // ShowFlags.SetCollisionPawn(false);
649  // ShowFlags.SetCollisionVisibility(false);
650  ShowFlags.SetColorGrading(false);
651  // ShowFlags.SetCompositeEditorPrimitives(false);
652  // ShowFlags.SetConstraints(false);
653  // ShowFlags.SetCover(false);
654  // ShowFlags.SetDebugAI(false);
655  // ShowFlags.SetDecals(false);
656  // ShowFlags.SetDeferredLighting(false);
657  ShowFlags.SetDepthOfField(false);
658  ShowFlags.SetDiffuse(false);
659  ShowFlags.SetDirectionalLights(false);
660  ShowFlags.SetDirectLighting(false);
661  // ShowFlags.SetDistanceCulledPrimitives(false);
662  // ShowFlags.SetDistanceFieldAO(false);
663  // ShowFlags.SetDistanceFieldGI(false);
664  ShowFlags.SetDynamicShadows(false);
665  // ShowFlags.SetEditor(false);
666  ShowFlags.SetEyeAdaptation(false);
667  ShowFlags.SetFog(false);
668  // ShowFlags.SetGame(false);
669  // ShowFlags.SetGameplayDebug(false);
670  // ShowFlags.SetGBufferHints(false);
671  ShowFlags.SetGlobalIllumination(false);
672  ShowFlags.SetGrain(false);
673  // ShowFlags.SetGrid(false);
674  // ShowFlags.SetHighResScreenshotMask(false);
675  // ShowFlags.SetHitProxies(false);
676  ShowFlags.SetHLODColoration(false);
677  ShowFlags.SetHMDDistortion(false);
678  // ShowFlags.SetIndirectLightingCache(false);
679  // ShowFlags.SetInstancedFoliage(false);
680  // ShowFlags.SetInstancedGrass(false);
681  // ShowFlags.SetInstancedStaticMeshes(false);
682  // ShowFlags.SetLandscape(false);
683  // ShowFlags.SetLargeVertices(false);
684  ShowFlags.SetLensFlares(false);
685  ShowFlags.SetLevelColoration(false);
686  ShowFlags.SetLightComplexity(false);
687  ShowFlags.SetLightFunctions(false);
688  ShowFlags.SetLightInfluences(false);
689  ShowFlags.SetLighting(false);
690  ShowFlags.SetLightMapDensity(false);
691  ShowFlags.SetLightRadius(false);
692  ShowFlags.SetLightShafts(false);
693  // ShowFlags.SetLOD(false);
694  ShowFlags.SetLODColoration(false);
695  // ShowFlags.SetMaterials(false);
696  // ShowFlags.SetMaterialTextureScaleAccuracy(false);
697  // ShowFlags.SetMeshEdges(false);
698  // ShowFlags.SetMeshUVDensityAccuracy(false);
699  // ShowFlags.SetModeWidgets(false);
700  ShowFlags.SetMotionBlur(false);
701  // ShowFlags.SetNavigation(false);
702  ShowFlags.SetOnScreenDebug(false);
703  // ShowFlags.SetOutputMaterialTextureScales(false);
704  // ShowFlags.SetOverrideDiffuseAndSpecular(false);
705  // ShowFlags.SetPaper2DSprites(false);
706  ShowFlags.SetParticles(false);
707  // ShowFlags.SetPivot(false);
708  ShowFlags.SetPointLights(false);
709  // ShowFlags.SetPostProcessing(false);
710  // ShowFlags.SetPostProcessMaterial(false);
711  // ShowFlags.SetPrecomputedVisibility(false);
712  // ShowFlags.SetPrecomputedVisibilityCells(false);
713  // ShowFlags.SetPreviewShadowsIndicator(false);
714  // ShowFlags.SetPrimitiveDistanceAccuracy(false);
715  ShowFlags.SetPropertyColoration(false);
716  // ShowFlags.SetQuadOverdraw(false);
717  // ShowFlags.SetReflectionEnvironment(false);
718  // ShowFlags.SetReflectionOverride(false);
719  ShowFlags.SetRefraction(false);
720  // ShowFlags.SetRendering(false);
721  ShowFlags.SetSceneColorFringe(false);
722  // ShowFlags.SetScreenPercentage(false);
723  ShowFlags.SetScreenSpaceAO(false);
724  ShowFlags.SetScreenSpaceReflections(false);
725  // ShowFlags.SetSelection(false);
726  // ShowFlags.SetSelectionOutline(false);
727  // ShowFlags.SetSeparateTranslucency(false);
728  // ShowFlags.SetShaderComplexity(false);
729  // ShowFlags.SetShaderComplexityWithQuadOverdraw(false);
730  // ShowFlags.SetShadowFrustums(false);
731  // ShowFlags.SetSkeletalMeshes(false);
732  // ShowFlags.SetSkinCache(false);
733  ShowFlags.SetSkyLighting(false);
734  // ShowFlags.SetSnap(false);
735  // ShowFlags.SetSpecular(false);
736  // ShowFlags.SetSplines(false);
737  ShowFlags.SetSpotLights(false);
738  // ShowFlags.SetStaticMeshes(false);
739  ShowFlags.SetStationaryLightOverlap(false);
740  // ShowFlags.SetStereoRendering(false);
741  // ShowFlags.SetStreamingBounds(false);
742  ShowFlags.SetSubsurfaceScattering(false);
743  // ShowFlags.SetTemporalAA(false);
744  // ShowFlags.SetTessellation(false);
745  // ShowFlags.SetTestImage(false);
746  // ShowFlags.SetTextRender(false);
747  // ShowFlags.SetTexturedLightProfiles(false);
748  ShowFlags.SetTonemapper(false);
749  // ShowFlags.SetTranslucency(false);
750  // ShowFlags.SetVectorFields(false);
751  // ShowFlags.SetVertexColors(false);
752  // ShowFlags.SetVignette(false);
753  // ShowFlags.SetVisLog(false);
754  // ShowFlags.SetVisualizeAdaptiveDOF(false);
755  // ShowFlags.SetVisualizeBloom(false);
756  ShowFlags.SetVisualizeBuffer(false);
757  ShowFlags.SetVisualizeDistanceFieldAO(false);
758  ShowFlags.SetVisualizeDOF(false);
759  ShowFlags.SetVisualizeHDR(false);
760  ShowFlags.SetVisualizeLightCulling(false);
761  ShowFlags.SetVisualizeLPV(false);
762  ShowFlags.SetVisualizeMeshDistanceFields(false);
763  ShowFlags.SetVisualizeMotionBlur(false);
764  ShowFlags.SetVisualizeOutOfBoundsPixels(false);
765  ShowFlags.SetVisualizeSenses(false);
766  ShowFlags.SetVisualizeShadingModels(false);
767  ShowFlags.SetVisualizeSSR(false);
768  ShowFlags.SetVisualizeSSS(false);
769  // ShowFlags.SetVolumeLightingSamples(false);
770  // ShowFlags.SetVolumes(false);
771  // ShowFlags.SetWidgetComponents(false);
772  // ShowFlags.SetWireframe(false);
773  }
774 
775 } // namespace SceneCaptureSensor_local_ns
EAutoExposureMethod GetExposureMethod() const
void SetFilmToe(float Toe)
void SetFilmWhiteClip(float WhiteClip)
uint32 ImageWidth
Image width in pixels.
void SetMotionBlurIntensity(float Intensity)
void SetExposureMethod(EAutoExposureMethod Method)
static auto SCENE_CAPTURE_COUNTER
void SetLensFlareIntensity(float Intensity)
float GetExposureCompensation() const
static void ConfigureShowFlags(FEngineShowFlags &ShowFlags, bool bPostProcessing=true)
void SetChromAberrIntensity(float Intensity)
void SetWhiteTint(float Tint)
void SetFOVAngle(float FOVAngle)
void SetChromAberrOffset(float ChromAberrOffset)
AWeather * GetWeather() const
Definition: CarlaEpisode.h:129
float GetDepthOfFieldMinFstop() const
float GetFilmWhiteClip() const
float GetExposureMinBrightness() const
void EnqueueRenderSceneImmediate()
Immediate enqueues render commands of the scene at the current time.
float GetMotionBlurMaxDistortion() const
void SetFilmSlope(float Slope)
float GetExposureSpeedDown() const
void SetFocalDistance(float Distance)
void SetBladeCount(int Count)
static bool IsValid(const ACarlaWheeledVehicle *Vehicle)
bool bEnable16BitFormat
Whether to change render target format to PF_A16B16G16R16, offering 16bit / channel.
static UCarlaSettings * GetCarlaSettings(const UObject *WorldContextObject)
Definition: CarlaStatics.h:74
static void SetCameraDefaultOverrides(USceneCaptureComponent2D &CaptureComponent2D)
void NotifyWeather()
Notifing the weather to the blueprint&#39;s event.
Definition: Weather.cpp:42
ASceneCaptureSensor(const FObjectInitializer &ObjectInitializer)
float GetExposureCalibrationConstant() const
static T Get(carla::rpc::Response< T > &response)
virtual void PostPhysTick(UWorld *World, ELevelTick TickType, float DeltaTime) override
float GetFilmBlackClip() const
float GetMotionBlurMinObjectScreenSize() const
void SetDepthBlurRadius(float Radius)
static void SetCamera(const FActorDescription &Description, ASceneCaptureSensor *Camera)
float GetDepthBlurAmount() const
float GetDepthBlurRadius() const
float GetLensFlareIntensity() const
virtual void SetUpSceneCaptureComponent(USceneCaptureComponent2D &SceneCapture)
A description of a Carla Actor with all its variation.
float GetChromAberrIntensity() const
void SetExposureMinBrightness(float Brightness)
void SetMotionBlurMaxDistortion(float MaxDistortion)
uint32 ImageHeight
Image height in pixels.
static auto GetQualitySettings(UWorld *World)
virtual void PrePhysTick(float DeltaSeconds) override
void SetFilmShoulder(float Shoulder)
void SetBloomIntensity(float Intensity)
float GetExposureSpeedUp() const
float GetChromAberrOffset() const
virtual void BeginPlay() override
void SetExposureSpeedDown(float Speed)
void SetWhiteTemp(float Temp)
USceneCaptureComponent2D * CaptureComponent2D
Scene capture component.
float GetExposureMaxBrightness() const
virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override
void SetImageSize(uint32 Width, uint32 Height)
void SetExposureMaxBrightness(float Brightness)
bool bEnablePostProcessingEffects
Whether to render the post-processing effects present in the scene.
float GetBloomIntensity() const
void SetExposureCompensation(float Compensation)
void SetExposureSpeedUp(float Speed)
void SetDepthBlurAmount(float Amount)
float GetMotionBlurIntensity() const
void SetFilmBlackClip(float BlackClip)
void SetAperture(float Aperture)
void SetDepthOfFieldMinFstop(float MinFstop)
void SetShutterSpeed(float Speed)
UTextureRenderTarget2D * CaptureRenderTarget
Render target necessary for scene capture.
void SetExposureCalibrationConstant(float Constant)
float GetFocalDistance() const
void SetMotionBlurMinObjectScreenSize(float ScreenSize)
void Set(const FActorDescription &ActorDescription) override