27 static void ConfigureShowFlags(FEngineShowFlags &ShowFlags,
bool bPostProcessing =
true);
32 check(Settings !=
nullptr);
33 return Settings->GetQualityLevel();
43 : Super(ObjectInitializer)
45 PrimaryActorTick.bCanEverTick =
true;
46 PrimaryActorTick.TickGroup = TG_PrePhysics;
62 CaptureComponent2D->PrimitiveRenderMode = ESceneCapturePrimitiveRenderMode::PRM_RenderScenePrimitives;
74 Super::Set(Description);
333 CaptureComponent2D->PostProcessSettings.AutoExposureCalibrationConstant_DEPRECATED = Constant;
339 return CaptureComponent2D->PostProcessSettings.AutoExposureCalibrationConstant_DEPRECATED;
441 CaptureComponent2D->PostProcessSettings.ChromaticAberrationStartOffset = ChromAberrOffset;
463 TEXT(
"SceneStencil"),
473 TEXT(
"CustomStencil"),
476template <EGBufferTextureID ID,
typename T>
479 GBufferStream.bIsUsed = GBufferStream.Stream.AreClientsListening();
480 if (GBufferStream.bIsUsed)
481 GBuffer.MarkAsRequested(ID);
488 auto GBufferPtr = MakeUnique<FGBufferRequest>();
489 auto& GBuffer = *GBufferPtr;
491 CheckGBufferStream<EGBufferTextureID::SceneColor>(
CameraGBuffers.SceneColor, GBuffer);
492 CheckGBufferStream<EGBufferTextureID::SceneDepth>(
CameraGBuffers.SceneDepth, GBuffer);
493 CheckGBufferStream<EGBufferTextureID::SceneStencil>(
CameraGBuffers.SceneStencil, GBuffer);
494 CheckGBufferStream<EGBufferTextureID::GBufferA>(
CameraGBuffers.GBufferA, GBuffer);
495 CheckGBufferStream<EGBufferTextureID::GBufferB>(
CameraGBuffers.GBufferB, GBuffer);
496 CheckGBufferStream<EGBufferTextureID::GBufferC>(
CameraGBuffers.GBufferC, GBuffer);
497 CheckGBufferStream<EGBufferTextureID::GBufferD>(
CameraGBuffers.GBufferD, GBuffer);
498 CheckGBufferStream<EGBufferTextureID::GBufferE>(
CameraGBuffers.GBufferE, GBuffer);
499 CheckGBufferStream<EGBufferTextureID::GBufferF>(
CameraGBuffers.GBufferF, GBuffer);
500 CheckGBufferStream<EGBufferTextureID::Velocity>(
CameraGBuffers.Velocity, GBuffer);
501 CheckGBufferStream<EGBufferTextureID::SSAO>(
CameraGBuffers.SSAO, GBuffer);
502 CheckGBufferStream<EGBufferTextureID::CustomDepth>(
CameraGBuffers.CustomDepth, GBuffer);
503 CheckGBufferStream<EGBufferTextureID::CustomStencil>(
CameraGBuffers.CustomStencil, GBuffer);
505 if (GBufferPtr->DesiredTexturesMask == 0)
512 if (
Prior != GBufferPtr->DesiredTexturesMask)
513 UE_LOG(LogCarla, Verbose, TEXT(
"GBuffer selection changed (%llu)."), GBufferPtr->DesiredTexturesMask);
515 Prior = GBufferPtr->DesiredTexturesMask;
518#define CARLA_GBUFFER_DISABLE_TAA
520#ifdef CARLA_GBUFFER_DISABLE_TAA
529#ifdef CARLA_GBUFFER_DISABLE_TAA
533#undef CARLA_GBUFFER_DISABLE_TAA
536 AsyncTask(ENamedThreads::AnyHiPriThreadNormalTask, [
this, GBuffer = MoveTemp(GBufferPtr)]()
mutable
555 bInForceLinearGamma);
576 UKismetSystemLibrary::ExecuteConsoleCommand(
578 FString(
"g.TimeoutForBlockOnRenderFence 300000"));
592 Super::PrePhysTick(DeltaSeconds);
596 IStreamingManager::Get().AddViewInformation(
604 Super::PostPhysTick(World, TickType, DeltaTime);
609 Super::EndPlay(EndPlayReason);
610 FlushRenderingCommands();
622 auto &PostProcessSettings = CaptureComponent2D.PostProcessSettings;
625 PostProcessSettings.bOverride_AutoExposureMethod =
true;
626 PostProcessSettings.AutoExposureMethod = EAutoExposureMethod::AEM_Histogram;
627 PostProcessSettings.bOverride_AutoExposureBias =
true;
628 PostProcessSettings.bOverride_AutoExposureMinBrightness =
true;
629 PostProcessSettings.bOverride_AutoExposureMaxBrightness =
true;
630 PostProcessSettings.bOverride_AutoExposureSpeedUp =
true;
631 PostProcessSettings.bOverride_AutoExposureSpeedDown =
true;
632 PostProcessSettings.bOverride_AutoExposureCalibrationConstant_DEPRECATED =
true;
633 PostProcessSettings.bOverride_HistogramLogMin =
true;
634 PostProcessSettings.HistogramLogMin = 1.0f;
635 PostProcessSettings.bOverride_HistogramLogMax =
true;
636 PostProcessSettings.HistogramLogMax = 12.0f;
639 PostProcessSettings.bOverride_CameraShutterSpeed =
true;
640 PostProcessSettings.bOverride_CameraISO =
true;
641 PostProcessSettings.bOverride_DepthOfFieldFstop =
true;
642 PostProcessSettings.bOverride_DepthOfFieldMinFstop =
true;
643 PostProcessSettings.bOverride_DepthOfFieldBladeCount =
true;
646 PostProcessSettings.bOverride_FilmSlope =
true;
647 PostProcessSettings.bOverride_FilmToe =
true;
648 PostProcessSettings.bOverride_FilmShoulder =
true;
649 PostProcessSettings.bOverride_FilmWhiteClip =
true;
650 PostProcessSettings.bOverride_FilmBlackClip =
true;
653 PostProcessSettings.bOverride_MotionBlurAmount =
true;
654 PostProcessSettings.MotionBlurAmount = 0.45f;
655 PostProcessSettings.bOverride_MotionBlurMax =
true;
656 PostProcessSettings.MotionBlurMax = 0.35f;
657 PostProcessSettings.bOverride_MotionBlurPerObjectSize =
true;
658 PostProcessSettings.MotionBlurPerObjectSize = 0.1f;
661 PostProcessSettings.bOverride_WhiteTemp =
true;
662 PostProcessSettings.bOverride_WhiteTint =
true;
663 PostProcessSettings.bOverride_ColorContrast =
true;
667 PostProcessSettings.ColorContrast = FVector4(1.2f, 1.2f, 1.2f, 1.0f);
671 PostProcessSettings.bOverride_SceneFringeIntensity =
true;
672 PostProcessSettings.bOverride_ChromaticAberrationStartOffset =
true;
675 PostProcessSettings.bOverride_AmbientOcclusionIntensity =
true;
676 PostProcessSettings.AmbientOcclusionIntensity = 0.5f;
677 PostProcessSettings.bOverride_AmbientOcclusionRadius =
true;
678 PostProcessSettings.AmbientOcclusionRadius = 100.0f;
679 PostProcessSettings.bOverride_AmbientOcclusionStaticFraction =
true;
680 PostProcessSettings.AmbientOcclusionStaticFraction = 1.0f;
681 PostProcessSettings.bOverride_AmbientOcclusionFadeDistance =
true;
682 PostProcessSettings.AmbientOcclusionFadeDistance = 50000.0f;
683 PostProcessSettings.bOverride_AmbientOcclusionPower =
true;
684 PostProcessSettings.AmbientOcclusionPower = 2.0f;
685 PostProcessSettings.bOverride_AmbientOcclusionBias =
true;
686 PostProcessSettings.AmbientOcclusionBias = 3.0f;
687 PostProcessSettings.bOverride_AmbientOcclusionQuality =
true;
688 PostProcessSettings.AmbientOcclusionQuality = 100.0f;
691 PostProcessSettings.bOverride_BloomMethod =
true;
692 PostProcessSettings.BloomMethod = EBloomMethod::BM_SOG;
693 PostProcessSettings.bOverride_BloomIntensity =
true;
694 PostProcessSettings.BloomIntensity = 0.675f;
695 PostProcessSettings.bOverride_BloomThreshold =
true;
696 PostProcessSettings.BloomThreshold = -1.0f;
699 PostProcessSettings.bOverride_LensFlareIntensity =
true;
700 PostProcessSettings.LensFlareIntensity = 0.1;
709 ShowFlags.EnableAdvancedFeatures();
710 ShowFlags.SetMotionBlur(
true);
714 ShowFlags.SetAmbientOcclusion(
false);
715 ShowFlags.SetAntiAliasing(
false);
716 ShowFlags.SetVolumetricFog(
false);
720 ShowFlags.SetBloom(
false);
729 ShowFlags.SetCameraImperfections(
false);
730 ShowFlags.SetCameraInterpolation(
false);
735 ShowFlags.SetColorGrading(
false);
742 ShowFlags.SetDepthOfField(
false);
743 ShowFlags.SetDiffuse(
false);
744 ShowFlags.SetDirectionalLights(
false);
745 ShowFlags.SetDirectLighting(
false);
749 ShowFlags.SetDynamicShadows(
false);
751 ShowFlags.SetEyeAdaptation(
false);
752 ShowFlags.SetFog(
false);
756 ShowFlags.SetGlobalIllumination(
false);
757 ShowFlags.SetGrain(
false);
761 ShowFlags.SetHLODColoration(
false);
762 ShowFlags.SetHMDDistortion(
false);
769 ShowFlags.SetLensFlares(
false);
770 ShowFlags.SetLevelColoration(
false);
771 ShowFlags.SetLightComplexity(
false);
772 ShowFlags.SetLightFunctions(
false);
773 ShowFlags.SetLightInfluences(
false);
774 ShowFlags.SetLighting(
false);
775 ShowFlags.SetLightMapDensity(
false);
776 ShowFlags.SetLightRadius(
false);
777 ShowFlags.SetLightShafts(
false);
779 ShowFlags.SetLODColoration(
false);
785 ShowFlags.SetMotionBlur(
false);
787 ShowFlags.SetOnScreenDebug(
false);
791 ShowFlags.SetParticles(
false);
793 ShowFlags.SetPointLights(
false);
800 ShowFlags.SetPropertyColoration(
false);
804 ShowFlags.SetRefraction(
false);
806 ShowFlags.SetSceneColorFringe(
false);
808 ShowFlags.SetScreenSpaceAO(
false);
809 ShowFlags.SetScreenSpaceReflections(
false);
818 ShowFlags.SetSkyLighting(
false);
822 ShowFlags.SetSpotLights(
false);
824 ShowFlags.SetStationaryLightOverlap(
false);
827 ShowFlags.SetSubsurfaceScattering(
false);
833 ShowFlags.SetTonemapper(
false);
841 ShowFlags.SetVisualizeBuffer(
false);
842 ShowFlags.SetVisualizeDistanceFieldAO(
false);
843 ShowFlags.SetVisualizeDOF(
false);
844 ShowFlags.SetVisualizeHDR(
false);
845 ShowFlags.SetVisualizeLightCulling(
false);
846 ShowFlags.SetVisualizeLPV(
false);
847 ShowFlags.SetVisualizeMeshDistanceFields(
false);
848 ShowFlags.SetVisualizeMotionBlur(
false);
849 ShowFlags.SetVisualizeOutOfBoundsPixels(
false);
850 ShowFlags.SetVisualizeSenses(
false);
851 ShowFlags.SetVisualizeShadingModels(
false);
852 ShowFlags.SetVisualizeSSR(
false);
853 ShowFlags.SetVisualizeSSS(
false);
static auto SCENE_CAPTURE_COUNTER
constexpr const TCHAR * GBufferNames[]
static void CheckGBufferStream(T &GBufferStream, FGBufferRequest &GBuffer)
static bool IsValid(const ACarlaWheeledVehicle *Vehicle)
float GetWhiteTint() const
void SetExposureMethod(EAutoExposureMethod Method)
void SetFOVAngle(float FOVAngle)
virtual void PrePhysTick(float DeltaSeconds) override
float GetMotionBlurMaxDistortion() const
void SetShutterSpeed(float Speed)
void SetImageSize(uint32 Width, uint32 Height)
void SetChromAberrIntensity(float Intensity)
float GetDepthOfFieldMinFstop() const
void SetMotionBlurMinObjectScreenSize(float ScreenSize)
void Set(const FActorDescription &ActorDescription) override
float GetDepthBlurRadius() const
float GetExposureSpeedUp() const
float GetChromAberrOffset() const
void SetFilmShoulder(float Shoulder)
void SetExposureCompensation(float Compensation)
void SetMotionBlurMaxDistortion(float MaxDistortion)
void SetDepthBlurAmount(float Amount)
void SetExposureMaxBrightness(float Brightness)
struct ASceneCaptureSensor::@0 CameraGBuffers
float GetLensFlareIntensity() const
void SetWhiteTemp(float Temp)
void SetFilmBlackClip(float BlackClip)
virtual void SendGBufferTextures(FGBufferRequest &GBuffer)
float GetMotionBlurMinObjectScreenSize() const
void SetExposureCalibrationConstant(float Constant)
void SetAperture(float Aperture)
uint32 ImageWidth
Image width in pixels.
float GetFOVAngle() const
void SetDepthBlurRadius(float Radius)
void SetFocalDistance(float Distance)
void SetChromAberrOffset(float ChromAberrOffset)
float GetAperture() const
float GetFilmWhiteClip() const
float GetDepthBlurAmount() const
USceneCaptureComponent2D * GetCaptureComponent2D()
float GetFilmSlope() const
float GetExposureMaxBrightness() const
void SetLensFlareIntensity(float Intensity)
void SetBladeCount(int Count)
UTextureRenderTarget2D * CaptureRenderTarget
Render target necessary for scene capture.
float GetBloomIntensity() const
int GetBladeCount() const
float GetChromAberrIntensity() const
void EnqueueRenderSceneImmediate()
Immediate enqueues render commands of the scene at the current time.
void SetFilmWhiteClip(float WhiteClip)
void SetBloomIntensity(float Intensity)
void SetMotionBlurIntensity(float Intensity)
void CaptureSceneExtended()
virtual void SetUpSceneCaptureComponent(USceneCaptureComponent2D &SceneCapture)
uint32 ImageHeight
Image height in pixels.
float GetExposureSpeedDown() const
void SetDepthOfFieldMinFstop(float MinFstop)
bool bEnable16BitFormat
Whether to change render target format to PF_A16B16G16R16, offering 16bit / channel
float GetShutterSpeed() const
bool bEnablePostProcessingEffects
Whether to render the post-processing effects present in the scene.
float GetExposureCalibrationConstant() const
float GetWhiteTemp() const
virtual void BeginPlay() override
float GetExposureCompensation() const
void SetWhiteTint(float Tint)
float GetFocalDistance() const
virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override
void SetFilmToe(float Toe)
ASceneCaptureSensor(const FObjectInitializer &ObjectInitializer)
EAutoExposureMethod GetExposureMethod() const
float GetExposureMinBrightness() const
void SetExposureSpeedDown(float Speed)
USceneCaptureComponent2D_CARLA * CaptureComponent2D
Scene capture component.
float GetFilmBlackClip() const
void SetFilmSlope(float Slope)
void SetExposureSpeedUp(float Speed)
float GetMotionBlurIntensity() const
void SetExposureMinBrightness(float Brightness)
virtual void PostPhysTick(UWorld *World, ELevelTick TickType, float DeltaTime) override
float GetFilmShoulder() const
void SendGBufferTexturesInternal(T &Self, FGBufferRequest &GBufferData)
const UCarlaEpisode & GetEpisode() const
void NotifyWeather(ASensor *Sensor=nullptr)
Notifing the weather to the blueprint's event
static void SetCamera(const FActorDescription &Description, ASceneCaptureSensor *Camera)
AWeather * GetWeather() const
static UCarlaSettings * GetCarlaSettings(const UObject *WorldContextObject)
virtual const AActor * GetViewOwner() const override
static void SetCameraDefaultOverrides(USceneCaptureComponent2D &CaptureComponent2D)
static void ConfigureShowFlags(FEngineShowFlags &ShowFlags, bool bPostProcessing=true)
static auto GetQualitySettings(UWorld *World)
A description of a Carla Actor with all its variation.