Fix Lumen, add PostProcessConfig. (#7705)
* Forcefully enable lumen for scene capture sensor, tweak ImageUtil.cpp. * Code changes in order to make the sensor camera look like the scene. * Remove commented code, fix Lumen being disabled by EnableAdvancedFeatures(). * Add FSceneCaptureSensorPostProcessOptions. * Introduce PostProcessConfig. * Remove reference. * Remove log call. * Remove ConfigureShowFlags prototype, re-enable SetCameraDefaultOverrides. * Reintroduce file end, switch back to _CARLA scene capture. * Add ASkyBase. * Reenable ViewActor. * Fix generated include. * Fix CreateDefaultSubobject call. * Update Sky. * Add remaining components to SkyBase. * Expose components to Blueprints. * Switch to components. * Update ctor. * Fix typo. * Fix BP variable visibility. * Add default subobjects. * Update defaults. * Update recommended values. * Add requested changes: fix indentation and SKyBase initialization. * Remove unwanted code. * Update ESceneCaptureSource. * Update ASkyBase component names. --------- Co-authored-by: Marcel Pi <25649656+MarcelPiNacy@users.noreply.github.com> Co-authored-by: Antonio Mata <artoniodev@gmail.com> Co-authored-by: Marcel Pi <marcelpi97@gmail.com>
This commit is contained in:
parent
de8c9b1b54
commit
85286d7565
|
@ -165,6 +165,10 @@
|
|||
{
|
||||
"Name": "MovieRenderPipeline",
|
||||
"Enabled": true
|
||||
},
|
||||
{
|
||||
"Name": "Volumetrics",
|
||||
"Enabled": true
|
||||
}
|
||||
],
|
||||
"TargetPlatforms": [
|
||||
|
|
|
@ -399,26 +399,26 @@ void UActorBlueprintFunctionLibrary::MakeCameraDefinition(
|
|||
FActorVariation MBIntesity;
|
||||
MBIntesity.Id = TEXT("motion_blur_intensity");
|
||||
MBIntesity.Type = EActorAttributeType::Float;
|
||||
MBIntesity.RecommendedValues = { TEXT("0.45") };
|
||||
MBIntesity.RecommendedValues = { TEXT("0.5") };
|
||||
MBIntesity.bRestrictToRecommended = false;
|
||||
|
||||
FActorVariation MBMaxDistortion;
|
||||
MBMaxDistortion.Id = TEXT("motion_blur_max_distortion");
|
||||
MBMaxDistortion.Type = EActorAttributeType::Float;
|
||||
MBMaxDistortion.RecommendedValues = { TEXT("0.35") };
|
||||
MBMaxDistortion.RecommendedValues = { TEXT("5.0") };
|
||||
MBMaxDistortion.bRestrictToRecommended = false;
|
||||
|
||||
FActorVariation MBMinObjectScreenSize;
|
||||
MBMinObjectScreenSize.Id = TEXT("motion_blur_min_object_screen_size");
|
||||
MBMinObjectScreenSize.Type = EActorAttributeType::Float;
|
||||
MBMinObjectScreenSize.RecommendedValues = { TEXT("0.1") };
|
||||
MBMinObjectScreenSize.RecommendedValues = { TEXT("0.0") };
|
||||
MBMinObjectScreenSize.bRestrictToRecommended = false;
|
||||
|
||||
// Lens Flare
|
||||
FActorVariation LensFlareIntensity;
|
||||
LensFlareIntensity.Id = TEXT("lens_flare_intensity");
|
||||
LensFlareIntensity.Type = EActorAttributeType::Float;
|
||||
LensFlareIntensity.RecommendedValues = { TEXT("0.1") };
|
||||
LensFlareIntensity.RecommendedValues = { TEXT("1.0") };
|
||||
LensFlareIntensity.bRestrictToRecommended = false;
|
||||
|
||||
// Bloom
|
||||
|
@ -450,7 +450,7 @@ void UActorBlueprintFunctionLibrary::MakeCameraDefinition(
|
|||
FActorVariation ExposureCompensation;
|
||||
ExposureCompensation.Id = TEXT("exposure_compensation");
|
||||
ExposureCompensation.Type = EActorAttributeType::Float;
|
||||
ExposureCompensation.RecommendedValues = { TEXT("0.0") };
|
||||
ExposureCompensation.RecommendedValues = { TEXT("1.0") };
|
||||
ExposureCompensation.bRestrictToRecommended = false;
|
||||
|
||||
// - Manual ------------------------------------------------
|
||||
|
@ -462,7 +462,7 @@ void UActorBlueprintFunctionLibrary::MakeCameraDefinition(
|
|||
FActorVariation ShutterSpeed; // (1/t)
|
||||
ShutterSpeed.Id = TEXT("shutter_speed");
|
||||
ShutterSpeed.Type = EActorAttributeType::Float;
|
||||
ShutterSpeed.RecommendedValues = { TEXT("200.0") };
|
||||
ShutterSpeed.RecommendedValues = { TEXT("60.0") };
|
||||
ShutterSpeed.bRestrictToRecommended = false;
|
||||
|
||||
// The camera sensor sensitivity.
|
||||
|
@ -477,7 +477,7 @@ void UActorBlueprintFunctionLibrary::MakeCameraDefinition(
|
|||
FActorVariation Aperture; // N
|
||||
Aperture.Id = TEXT("fstop");
|
||||
Aperture.Type = EActorAttributeType::Float;
|
||||
Aperture.RecommendedValues = { TEXT("1.4") };
|
||||
Aperture.RecommendedValues = { TEXT("4.0") };
|
||||
Aperture.bRestrictToRecommended = false;
|
||||
|
||||
// - Histogram ---------------------------------------------
|
||||
|
@ -487,7 +487,7 @@ void UActorBlueprintFunctionLibrary::MakeCameraDefinition(
|
|||
FActorVariation ExposureMinBright;
|
||||
ExposureMinBright.Id = TEXT("exposure_min_bright");
|
||||
ExposureMinBright.Type = EActorAttributeType::Float;
|
||||
ExposureMinBright.RecommendedValues = { TEXT("10.0") };
|
||||
ExposureMinBright.RecommendedValues = { TEXT("-10.0") };
|
||||
ExposureMinBright.bRestrictToRecommended = false;
|
||||
|
||||
// The maximum brightness for auto exposure that limits the upper
|
||||
|
@ -495,7 +495,7 @@ void UActorBlueprintFunctionLibrary::MakeCameraDefinition(
|
|||
FActorVariation ExposureMaxBright;
|
||||
ExposureMaxBright.Id = TEXT("exposure_max_bright");
|
||||
ExposureMaxBright.Type = EActorAttributeType::Float;
|
||||
ExposureMaxBright.RecommendedValues = { TEXT("12.0") };
|
||||
ExposureMaxBright.RecommendedValues = { TEXT("20.0") };
|
||||
ExposureMaxBright.bRestrictToRecommended = false;
|
||||
|
||||
// The speed at which the adaptation occurs from a dark environment
|
||||
|
@ -526,7 +526,7 @@ void UActorBlueprintFunctionLibrary::MakeCameraDefinition(
|
|||
FActorVariation FocalDistance;
|
||||
FocalDistance.Id = TEXT("focal_distance");
|
||||
FocalDistance.Type = EActorAttributeType::Float;
|
||||
FocalDistance.RecommendedValues = { TEXT("1000.0") };
|
||||
FocalDistance.RecommendedValues = { TEXT("0.0") };
|
||||
FocalDistance.bRestrictToRecommended = false;
|
||||
|
||||
// Depth blur km for 50%
|
||||
|
@ -1556,11 +1556,11 @@ void UActorBlueprintFunctionLibrary::SetCamera(
|
|||
Camera->SetMotionBlurMaxDistortion(
|
||||
RetrieveActorAttributeToFloat("motion_blur_max_distortion", Description.Variations, 5.0f));
|
||||
Camera->SetMotionBlurMinObjectScreenSize(
|
||||
RetrieveActorAttributeToFloat("motion_blur_min_object_screen_size", Description.Variations, 0.5f));
|
||||
RetrieveActorAttributeToFloat("motion_blur_min_object_screen_size", Description.Variations, 0.0f));
|
||||
Camera->SetLensFlareIntensity(
|
||||
RetrieveActorAttributeToFloat("lens_flare_intensity", Description.Variations, 0.1f));
|
||||
RetrieveActorAttributeToFloat("lens_flare_intensity", Description.Variations, 1.0f));
|
||||
Camera->SetBloomIntensity(
|
||||
RetrieveActorAttributeToFloat("bloom_intensity", Description.Variations, 0.675f));
|
||||
RetrieveActorAttributeToFloat("bloom_intensity", Description.Variations, 0.675000f));
|
||||
// Exposure, histogram mode by default
|
||||
if (RetrieveActorAttributeToString("exposure_mode", Description.Variations, "histogram") == "histogram")
|
||||
{
|
||||
|
@ -1571,27 +1571,28 @@ void UActorBlueprintFunctionLibrary::SetCamera(
|
|||
Camera->SetExposureMethod(EAutoExposureMethod::AEM_Manual);
|
||||
}
|
||||
Camera->SetExposureCompensation(
|
||||
RetrieveActorAttributeToFloat("exposure_compensation", Description.Variations, 0.0f));
|
||||
RetrieveActorAttributeToFloat("exposure_compensation", Description.Variations, 1.0f));
|
||||
Camera->SetShutterSpeed(
|
||||
RetrieveActorAttributeToFloat("shutter_speed", Description.Variations, 200.0f));
|
||||
RetrieveActorAttributeToFloat("shutter_speed", Description.Variations, 60.0f));
|
||||
Camera->SetISO(
|
||||
RetrieveActorAttributeToFloat("iso", Description.Variations, 100.0f));
|
||||
Camera->SetAperture(
|
||||
RetrieveActorAttributeToFloat("fstop", Description.Variations, 1.4f));
|
||||
RetrieveActorAttributeToFloat("fstop", Description.Variations, 4.0f));
|
||||
|
||||
Camera->SetExposureMinBrightness(
|
||||
RetrieveActorAttributeToFloat("exposure_min_bright", Description.Variations, 7.0f));
|
||||
RetrieveActorAttributeToFloat("exposure_min_bright", Description.Variations, -10.0f));
|
||||
Camera->SetExposureMaxBrightness(
|
||||
RetrieveActorAttributeToFloat("exposure_max_bright", Description.Variations, 9.0f));
|
||||
RetrieveActorAttributeToFloat("exposure_max_bright", Description.Variations, 20.0f));
|
||||
Camera->SetExposureSpeedUp(
|
||||
RetrieveActorAttributeToFloat("exposure_speed_up", Description.Variations, 3.0f));
|
||||
Camera->SetExposureSpeedDown(
|
||||
RetrieveActorAttributeToFloat("exposure_speed_down", Description.Variations, 1.0f));
|
||||
// This is deprecated:
|
||||
Camera->SetExposureCalibrationConstant(
|
||||
RetrieveActorAttributeToFloat("calibration_constant", Description.Variations, 16.0f));
|
||||
|
||||
Camera->SetFocalDistance(
|
||||
RetrieveActorAttributeToFloat("focal_distance", Description.Variations, 1000.0f));
|
||||
RetrieveActorAttributeToFloat("focal_distance", Description.Variations, 0.0f));
|
||||
Camera->SetDepthBlurAmount(
|
||||
RetrieveActorAttributeToFloat("blur_amount", Description.Variations, 1.0f));
|
||||
Camera->SetDepthBlurRadius(
|
||||
|
|
|
@ -109,13 +109,13 @@ namespace ImageUtil
|
|||
case PF_FloatRGBA:
|
||||
case PF_R16G16B16A16_UNORM:
|
||||
case PF_R16G16B16A16_SNORM:
|
||||
ConvertRawR16G16B16A16FDataToFColor(DestinationExtent.X, DestinationExtent.Y, (uint8*)PixelData, SourcePitch, Out.GetData(), false);
|
||||
ConvertRawR16G16B16A16FDataToFColor(DestinationExtent.X, DestinationExtent.Y, (uint8*)PixelData, SourcePitch, Out.GetData(), Flags.GetLinearToGamma());
|
||||
break;
|
||||
case PF_FloatR11G11B10:
|
||||
ConvertRawR11G11B10DataToFColor(DestinationExtent.X, DestinationExtent.Y, (uint8*)PixelData, SourcePitch, Out.GetData(), false);
|
||||
ConvertRawR11G11B10DataToFColor(DestinationExtent.X, DestinationExtent.Y, (uint8*)PixelData, SourcePitch, Out.GetData(), Flags.GetLinearToGamma());
|
||||
break;
|
||||
case PF_A32B32G32R32F:
|
||||
ConvertRawR32G32B32A32DataToFColor(DestinationExtent.X, DestinationExtent.Y, (uint8*)PixelData, SourcePitch, Out.GetData(), false);
|
||||
ConvertRawR32G32B32A32DataToFColor(DestinationExtent.X, DestinationExtent.Y, (uint8*)PixelData, SourcePitch, Out.GetData(), Flags.GetLinearToGamma());
|
||||
break;
|
||||
case PF_A16B16G16R16:
|
||||
ConvertRawR16G16B16A16DataToFColor(DestinationExtent.X, DestinationExtent.Y, (uint8*)PixelData, SourcePitch, Out.GetData());
|
||||
|
|
|
@ -0,0 +1,201 @@
|
|||
#include "PostProcessConfig.h"
|
||||
#include "Components/SceneCaptureComponent.h"
|
||||
#include "Components/SceneCaptureComponent2D.h"
|
||||
|
||||
void FPostProcessConfig::EnablePostProcessingEffects()
|
||||
{
|
||||
// This block of code {
|
||||
EngineShowFlags.SetLensFlares(true);
|
||||
EngineShowFlags.SetEyeAdaptation(true);
|
||||
EngineShowFlags.SetColorGrading(true);
|
||||
EngineShowFlags.SetCameraImperfections(true);
|
||||
EngineShowFlags.SetDepthOfField(true);
|
||||
EngineShowFlags.SetVignette(true);
|
||||
EngineShowFlags.SetGrain(true);
|
||||
EngineShowFlags.SetSeparateTranslucency(true);
|
||||
EngineShowFlags.SetScreenSpaceReflections(true);
|
||||
EngineShowFlags.SetTemporalAA(true);
|
||||
EngineShowFlags.SetAmbientOcclusion(true);
|
||||
EngineShowFlags.SetIndirectLightingCache(true);
|
||||
EngineShowFlags.SetLightShafts(true);
|
||||
EngineShowFlags.SetPostProcessMaterial(true);
|
||||
EngineShowFlags.SetDistanceFieldAO(true);
|
||||
// TODO: Remove when Physical page pool size scales automatically with demand
|
||||
EngineShowFlags.SetVirtualShadowMapCaching(false);
|
||||
// } must be kept in sync with EngineShowFlags.EnableAdvancedFeatures(), AND activate Lumen.
|
||||
EngineShowFlags.SetMotionBlur(true);
|
||||
}
|
||||
|
||||
void FPostProcessConfig::DisablePostProcessingEffects()
|
||||
{
|
||||
EngineShowFlags.SetAmbientOcclusion(false);
|
||||
EngineShowFlags.SetAntiAliasing(false);
|
||||
EngineShowFlags.SetVolumetricFog(false);
|
||||
// EngineShowFlags.SetAtmosphericFog(false);
|
||||
// EngineShowFlags.SetAudioRadius(false);
|
||||
// EngineShowFlags.SetBillboardSprites(false);
|
||||
EngineShowFlags.SetBloom(false);
|
||||
// EngineShowFlags.SetBounds(false);
|
||||
// EngineShowFlags.SetBrushes(false);
|
||||
// EngineShowFlags.SetBSP(false);
|
||||
// EngineShowFlags.SetBSPSplit(false);
|
||||
// EngineShowFlags.SetBSPTriangles(false);
|
||||
// EngineShowFlags.SetBuilderBrush(false);
|
||||
// EngineShowFlags.SetCameraAspectRatioBars(false);
|
||||
// EngineShowFlags.SetCameraFrustums(false);
|
||||
EngineShowFlags.SetCameraImperfections(false);
|
||||
EngineShowFlags.SetCameraInterpolation(false);
|
||||
// EngineShowFlags.SetCameraSafeFrames(false);
|
||||
// EngineShowFlags.SetCollision(false);
|
||||
// EngineShowFlags.SetCollisionPawn(false);
|
||||
// EngineShowFlags.SetCollisionVisibility(false);
|
||||
EngineShowFlags.SetColorGrading(false);
|
||||
// EngineShowFlags.SetCompositeEditorPrimitives(false);
|
||||
// EngineShowFlags.SetConstraints(false);
|
||||
// EngineShowFlags.SetCover(false);
|
||||
// EngineShowFlags.SetDebugAI(false);
|
||||
// EngineShowFlags.SetDecals(false);
|
||||
// EngineShowFlags.SetDeferredLighting(false);
|
||||
EngineShowFlags.SetDepthOfField(false);
|
||||
EngineShowFlags.SetDiffuse(false);
|
||||
EngineShowFlags.SetDirectionalLights(false);
|
||||
EngineShowFlags.SetDirectLighting(false);
|
||||
// EngineShowFlags.SetDistanceCulledPrimitives(false);
|
||||
// EngineShowFlags.SetDistanceFieldAO(false);
|
||||
// EngineShowFlags.SetDistanceFieldGI(false);
|
||||
EngineShowFlags.SetDynamicShadows(false);
|
||||
// EngineShowFlags.SetEditor(false);
|
||||
EngineShowFlags.SetEyeAdaptation(false);
|
||||
EngineShowFlags.SetFog(false);
|
||||
// EngineShowFlags.SetGame(false);
|
||||
// EngineShowFlags.SetGameplayDebug(false);
|
||||
// EngineShowFlags.SetGBufferHints(false);
|
||||
EngineShowFlags.SetGlobalIllumination(false);
|
||||
EngineShowFlags.SetGrain(false);
|
||||
// EngineShowFlags.SetGrid(false);
|
||||
// EngineShowFlags.SetHighResScreenshotMask(false);
|
||||
// EngineShowFlags.SetHitProxies(false);
|
||||
EngineShowFlags.SetHLODColoration(false);
|
||||
EngineShowFlags.SetHMDDistortion(false);
|
||||
// EngineShowFlags.SetIndirectLightingCache(false);
|
||||
// EngineShowFlags.SetInstancedFoliage(false);
|
||||
// EngineShowFlags.SetInstancedGrass(false);
|
||||
// EngineShowFlags.SetInstancedStaticMeshes(false);
|
||||
// EngineShowFlags.SetLandscape(false);
|
||||
// EngineShowFlags.SetLargeVertices(false);
|
||||
EngineShowFlags.SetLensFlares(false);
|
||||
EngineShowFlags.SetLevelColoration(false);
|
||||
EngineShowFlags.SetLightComplexity(false);
|
||||
EngineShowFlags.SetLightFunctions(false);
|
||||
EngineShowFlags.SetLightInfluences(false);
|
||||
EngineShowFlags.SetLighting(false);
|
||||
EngineShowFlags.SetLightMapDensity(false);
|
||||
EngineShowFlags.SetLightRadius(false);
|
||||
EngineShowFlags.SetLightShafts(false);
|
||||
// EngineShowFlags.SetLOD(false);
|
||||
EngineShowFlags.SetLODColoration(false);
|
||||
// EngineShowFlags.SetMaterials(false);
|
||||
// EngineShowFlags.SetMaterialTextureScaleAccuracy(false);
|
||||
// EngineShowFlags.SetMeshEdges(false);
|
||||
// EngineShowFlags.SetMeshUVDensityAccuracy(false);
|
||||
// EngineShowFlags.SetModeWidgets(false);
|
||||
EngineShowFlags.SetMotionBlur(false);
|
||||
// EngineShowFlags.SetNavigation(false);
|
||||
EngineShowFlags.SetOnScreenDebug(false);
|
||||
// EngineShowFlags.SetOutputMaterialTextureScales(false);
|
||||
// EngineShowFlags.SetOverrideDiffuseAndSpecular(false);
|
||||
// EngineShowFlags.SetPaper2DSprites(false);
|
||||
EngineShowFlags.SetParticles(false);
|
||||
// EngineShowFlags.SetPivot(false);
|
||||
EngineShowFlags.SetPointLights(false);
|
||||
// EngineShowFlags.SetPostProcessing(false);
|
||||
// EngineShowFlags.SetPostProcessMaterial(false);
|
||||
// EngineShowFlags.SetPrecomputedVisibility(false);
|
||||
// EngineShowFlags.SetPrecomputedVisibilityCells(false);
|
||||
// EngineShowFlags.SetPreviewShadowsIndicator(false);
|
||||
// EngineShowFlags.SetPrimitiveDistanceAccuracy(false);
|
||||
EngineShowFlags.SetPropertyColoration(false);
|
||||
// EngineShowFlags.SetQuadOverdraw(false);
|
||||
// EngineShowFlags.SetReflectionEnvironment(false);
|
||||
// EngineShowFlags.SetReflectionOverride(false);
|
||||
EngineShowFlags.SetRefraction(false);
|
||||
// EngineShowFlags.SetRendering(false);
|
||||
EngineShowFlags.SetSceneColorFringe(false);
|
||||
// EngineShowFlags.SetScreenPercentage(false);
|
||||
EngineShowFlags.SetScreenSpaceAO(false);
|
||||
EngineShowFlags.SetScreenSpaceReflections(false);
|
||||
// EngineShowFlags.SetSelection(false);
|
||||
// EngineShowFlags.SetSelectionOutline(false);
|
||||
// EngineShowFlags.SetSeparateTranslucency(false);
|
||||
// EngineShowFlags.SetShaderComplexity(false);
|
||||
// EngineShowFlags.SetShaderComplexityWithQuadOverdraw(false);
|
||||
// EngineShowFlags.SetShadowFrustums(false);
|
||||
// EngineShowFlags.SetSkeletalMeshes(false);
|
||||
// EngineShowFlags.SetSkinCache(false);
|
||||
EngineShowFlags.SetSkyLighting(false);
|
||||
// EngineShowFlags.SetSnap(false);
|
||||
// EngineShowFlags.SetSpecular(false);
|
||||
// EngineShowFlags.SetSplines(false);
|
||||
EngineShowFlags.SetSpotLights(false);
|
||||
// EngineShowFlags.SetStaticMeshes(false);
|
||||
EngineShowFlags.SetStationaryLightOverlap(false);
|
||||
// EngineShowFlags.SetStereoRendering(false);
|
||||
// EngineShowFlags.SetStreamingBounds(false);
|
||||
EngineShowFlags.SetSubsurfaceScattering(false);
|
||||
// EngineShowFlags.SetTemporalAA(false);
|
||||
// EngineShowFlags.SetTessellation(false);
|
||||
// EngineShowFlags.SetTestImage(false);
|
||||
// EngineShowFlags.SetTextRender(false);
|
||||
// EngineShowFlags.SetTexturedLightProfiles(false);
|
||||
EngineShowFlags.SetTonemapper(false);
|
||||
// EngineShowFlags.SetTranslucency(false);
|
||||
// EngineShowFlags.SetVectorFields(false);
|
||||
// EngineShowFlags.SetVertexColors(false);
|
||||
// EngineShowFlags.SetVignette(false);
|
||||
// EngineShowFlags.SetVisLog(false);
|
||||
// EngineShowFlags.SetVisualizeAdaptiveDOF(false);
|
||||
// EngineShowFlags.SetVisualizeBloom(false);
|
||||
EngineShowFlags.SetVisualizeBuffer(false);
|
||||
EngineShowFlags.SetVisualizeDistanceFieldAO(false);
|
||||
EngineShowFlags.SetVisualizeDOF(false);
|
||||
EngineShowFlags.SetVisualizeHDR(false);
|
||||
EngineShowFlags.SetVisualizeLightCulling(false);
|
||||
EngineShowFlags.SetVisualizeMeshDistanceFields(false);
|
||||
EngineShowFlags.SetVisualizeMotionBlur(false);
|
||||
EngineShowFlags.SetVisualizeOutOfBoundsPixels(false);
|
||||
EngineShowFlags.SetVisualizeSenses(false);
|
||||
EngineShowFlags.SetVisualizeShadingModels(false);
|
||||
EngineShowFlags.SetVisualizeSSR(false);
|
||||
EngineShowFlags.SetVisualizeSSS(false);
|
||||
// EngineShowFlags.SetVolumeLightingSamples(false);
|
||||
// EngineShowFlags.SetVolumes(false);
|
||||
// EngineShowFlags.SetWidgetComponents(false);
|
||||
// EngineShowFlags.SetWireframe(false);
|
||||
}
|
||||
|
||||
FPostProcessConfig::FPostProcessConfig(
|
||||
FPostProcessSettings& InPostProcessSettings,
|
||||
FEngineShowFlags& InEngineShowFlags) :
|
||||
PostProcessSettings(InPostProcessSettings),
|
||||
EngineShowFlags(InEngineShowFlags)
|
||||
{
|
||||
}
|
||||
|
||||
void FPostProcessConfig::UpdateFromSceneCaptureComponent(const USceneCaptureComponent& Component)
|
||||
{
|
||||
EngineShowFlags = Component.ShowFlags;
|
||||
}
|
||||
|
||||
void FPostProcessConfig::UpdateFromSceneCaptureComponent2D(const USceneCaptureComponent2D& Component)
|
||||
{
|
||||
EngineShowFlags = Component.ShowFlags;
|
||||
PostProcessSettings = Component.PostProcessSettings;
|
||||
}
|
||||
|
||||
void FPostProcessConfig::EnablePostProcessingEffects(bool Enable)
|
||||
{
|
||||
if (Enable)
|
||||
EnablePostProcessingEffects();
|
||||
else
|
||||
DisablePostProcessingEffects();
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
#pragma once
|
||||
#include "Engine/Scene.h"
|
||||
|
||||
|
||||
|
||||
class CARLA_API FPostProcessConfig
|
||||
{
|
||||
void EnablePostProcessingEffects();
|
||||
void DisablePostProcessingEffects();
|
||||
|
||||
public:
|
||||
|
||||
FPostProcessConfig(
|
||||
FPostProcessSettings& InPostProcessSettings,
|
||||
FEngineShowFlags& InEngineShowFlags);
|
||||
~FPostProcessConfig() = default;
|
||||
|
||||
void UpdateFromSceneCaptureComponent(const class USceneCaptureComponent& Component);
|
||||
void UpdateFromSceneCaptureComponent2D(const class USceneCaptureComponent2D& Component);
|
||||
void EnablePostProcessingEffects(bool Enable);
|
||||
|
||||
FPostProcessSettings PostProcessSettings;
|
||||
FEngineShowFlags EngineShowFlags;
|
||||
|
||||
};
|
|
@ -5,10 +5,12 @@
|
|||
// For a copy, see <https://opensource.org/licenses/MIT>.
|
||||
|
||||
#include "Carla/Sensor/SceneCaptureSensor.h"
|
||||
#include "Carla/Sensor/PostProcessConfig.h"
|
||||
#include "Carla.h"
|
||||
#include "Carla/Game/CarlaStatics.h"
|
||||
#include "Actor/ActorBlueprintFunctionLibrary.h"
|
||||
#include "Engine/PostProcessVolume.h"
|
||||
#include "GameFramework/SpectatorPawn.h"
|
||||
|
||||
#include <mutex>
|
||||
#include <atomic>
|
||||
|
@ -25,8 +27,6 @@ namespace SceneCaptureSensor_local_ns {
|
|||
|
||||
static void SetCameraDefaultOverrides(USceneCaptureComponent2D &CaptureComponent2D);
|
||||
|
||||
static void ConfigureShowFlags(FEngineShowFlags &ShowFlags, bool bPostProcessing = true);
|
||||
|
||||
static auto GetQualitySettings(UWorld *World)
|
||||
{
|
||||
auto Settings = UCarlaStatics::GetCarlaSettings(World);
|
||||
|
@ -56,7 +56,7 @@ ASceneCaptureSensor::ASceneCaptureSensor(const FObjectInitializer &ObjectInitial
|
|||
CaptureRenderTarget->AddressY = TextureAddress::TA_Clamp;
|
||||
|
||||
CaptureComponent2D = CreateDefaultSubobject<USceneCaptureComponent2D_CARLA>(
|
||||
FName(*FString::Printf(TEXT("USceneCaptureComponent2D_CARLA_%d"), SCENE_CAPTURE_COUNTER)));
|
||||
FName(*FString::Printf(TEXT("USceneCaptureComponent2D%d"), SCENE_CAPTURE_COUNTER)));
|
||||
check(CaptureComponent2D != nullptr);
|
||||
CaptureComponent2D->ViewActor = this;
|
||||
CaptureComponent2D->SetupAttachment(RootComponent);
|
||||
|
@ -449,6 +449,11 @@ float ASceneCaptureSensor::GetChromAberrOffset() const
|
|||
return CaptureComponent2D->PostProcessSettings.ChromaticAberrationStartOffset;
|
||||
}
|
||||
|
||||
void ASceneCaptureSensor::UpdatePostProcessConfig(
|
||||
FPostProcessConfig& InOutPostProcessConfig)
|
||||
{
|
||||
}
|
||||
|
||||
bool ASceneCaptureSensor::ApplyPostProcessVolumeToSensor(APostProcessVolume* Origin, ASceneCaptureSensor* Dest, bool bOverrideCurrentCamera)
|
||||
{
|
||||
if(!IsValid(Origin) || !IsValid(Dest))
|
||||
|
@ -548,8 +553,11 @@ void ASceneCaptureSensor::BeginPlay()
|
|||
// Determine the gamma of the player.
|
||||
const bool bInForceLinearGamma = !bEnablePostProcessingEffects;
|
||||
|
||||
CaptureRenderTarget->InitCustomFormat(ImageWidth, ImageHeight, bEnable16BitFormat ? PF_FloatRGBA : PF_B8G8R8A8,
|
||||
bInForceLinearGamma);
|
||||
CaptureRenderTarget->InitCustomFormat(
|
||||
ImageWidth,
|
||||
ImageHeight,
|
||||
bEnable16BitFormat ? PF_FloatRGBA : PF_B8G8R8A8,
|
||||
bInForceLinearGamma);
|
||||
|
||||
if (bEnablePostProcessingEffects)
|
||||
{
|
||||
|
@ -574,13 +582,19 @@ void ASceneCaptureSensor::BeginPlay()
|
|||
GetWorld(),
|
||||
FString("g.TimeoutForBlockOnRenderFence 300000"));
|
||||
|
||||
SceneCaptureSensor_local_ns::ConfigureShowFlags(CaptureComponent2D->ShowFlags,
|
||||
bEnablePostProcessingEffects);
|
||||
auto PostProcessConfig = FPostProcessConfig(
|
||||
CaptureComponent2D->PostProcessSettings,
|
||||
CaptureComponent2D->ShowFlags);
|
||||
PostProcessConfig.UpdateFromSceneCaptureComponent2D(*CaptureComponent2D);
|
||||
PostProcessConfig.EnablePostProcessingEffects(ArePostProcessingEffectsEnabled());
|
||||
UpdatePostProcessConfig(PostProcessConfig);
|
||||
CaptureComponent2D->ShowFlags = PostProcessConfig.EngineShowFlags;
|
||||
CaptureComponent2D->PostProcessSettings = PostProcessConfig.PostProcessSettings;
|
||||
|
||||
// This ensures the camera is always spawning the raindrops in case the
|
||||
// weather was previously set to have rain.
|
||||
GetEpisode().GetWeather()->NotifyWeather(this);
|
||||
|
||||
|
||||
Super::BeginPlay();
|
||||
}
|
||||
|
||||
|
@ -713,239 +727,41 @@ namespace SceneCaptureSensor_local_ns {
|
|||
{
|
||||
auto &PostProcessSettings = CaptureComponent2D.PostProcessSettings;
|
||||
|
||||
// Exposure
|
||||
PostProcessSettings.bOverride_AutoExposureMethod = true;
|
||||
PostProcessSettings.AutoExposureMethod = EAutoExposureMethod::AEM_Histogram;
|
||||
PostProcessSettings.bOverride_AutoExposureBias = true;
|
||||
PostProcessSettings.bOverride_AutoExposureMinBrightness = true;
|
||||
PostProcessSettings.bOverride_AutoExposureMaxBrightness = true;
|
||||
PostProcessSettings.bOverride_AutoExposureSpeedUp = true;
|
||||
PostProcessSettings.bOverride_AutoExposureSpeedDown = true;
|
||||
PostProcessSettings.bOverride_AutoExposureCalibrationConstant_DEPRECATED = true;
|
||||
PostProcessSettings.bOverride_HistogramLogMin = true;
|
||||
PostProcessSettings.HistogramLogMin = 1.0f;
|
||||
PostProcessSettings.bOverride_HistogramLogMax = true;
|
||||
PostProcessSettings.HistogramLogMax = 12.0f;
|
||||
|
||||
// Camera
|
||||
PostProcessSettings.bOverride_CameraShutterSpeed = true;
|
||||
PostProcessSettings.bOverride_CameraISO = true;
|
||||
PostProcessSettings.bOverride_DepthOfFieldFstop = true;
|
||||
PostProcessSettings.bOverride_DepthOfFieldMinFstop = true;
|
||||
PostProcessSettings.bOverride_DepthOfFieldBladeCount = true;
|
||||
|
||||
// Film (Tonemapper)
|
||||
PostProcessSettings.bOverride_FilmSlope = true;
|
||||
PostProcessSettings.bOverride_FilmToe = true;
|
||||
PostProcessSettings.bOverride_FilmShoulder = true;
|
||||
PostProcessSettings.bOverride_FilmWhiteClip = true;
|
||||
PostProcessSettings.bOverride_FilmBlackClip = true;
|
||||
|
||||
// Motion blur
|
||||
PostProcessSettings.bOverride_MotionBlurAmount = true;
|
||||
PostProcessSettings.MotionBlurAmount = 0.45f;
|
||||
PostProcessSettings.bOverride_MotionBlurMax = true;
|
||||
PostProcessSettings.MotionBlurMax = 0.35f;
|
||||
PostProcessSettings.bOverride_MotionBlurPerObjectSize = true;
|
||||
PostProcessSettings.MotionBlurPerObjectSize = 0.1f;
|
||||
|
||||
// Color Grading
|
||||
PostProcessSettings.bOverride_WhiteTemp = true;
|
||||
PostProcessSettings.bOverride_WhiteTint = true;
|
||||
PostProcessSettings.bOverride_ColorContrast = true;
|
||||
#if PLATFORM_LINUX
|
||||
// Looks like Windows and Linux have different outputs with the
|
||||
// same exposure compensation, this fixes it.
|
||||
PostProcessSettings.ColorContrast = FVector4(1.2f, 1.2f, 1.2f, 1.0f);
|
||||
#endif
|
||||
|
||||
// Chromatic Aberration
|
||||
PostProcessSettings.bOverride_SceneFringeIntensity = true;
|
||||
PostProcessSettings.bOverride_ChromaticAberrationStartOffset = true;
|
||||
|
||||
// Ambient Occlusion
|
||||
PostProcessSettings.bOverride_AmbientOcclusionIntensity = true;
|
||||
PostProcessSettings.AmbientOcclusionIntensity = 0.5f;
|
||||
PostProcessSettings.bOverride_AmbientOcclusionRadius = true;
|
||||
PostProcessSettings.AmbientOcclusionRadius = 100.0f;
|
||||
PostProcessSettings.bOverride_AmbientOcclusionStaticFraction = true;
|
||||
PostProcessSettings.AmbientOcclusionStaticFraction = 1.0f;
|
||||
PostProcessSettings.bOverride_AmbientOcclusionFadeDistance = true;
|
||||
PostProcessSettings.AmbientOcclusionFadeDistance = 50000.0f;
|
||||
PostProcessSettings.bOverride_AmbientOcclusionPower = true;
|
||||
PostProcessSettings.AmbientOcclusionPower = 2.0f;
|
||||
PostProcessSettings.bOverride_AmbientOcclusionBias = true;
|
||||
PostProcessSettings.AmbientOcclusionBias = 3.0f;
|
||||
PostProcessSettings.bOverride_AmbientOcclusionQuality = true;
|
||||
PostProcessSettings.AmbientOcclusionQuality = 100.0f;
|
||||
|
||||
// Bloom
|
||||
PostProcessSettings.bOverride_BloomMethod = true;
|
||||
PostProcessSettings.BloomMethod = EBloomMethod::BM_SOG;
|
||||
PostProcessSettings.bOverride_BloomIntensity = true;
|
||||
PostProcessSettings.BloomIntensity = 0.675f;
|
||||
PostProcessSettings.bOverride_BloomThreshold = true;
|
||||
PostProcessSettings.BloomThreshold = -1.0f;
|
||||
|
||||
// Lens
|
||||
PostProcessSettings.bOverride_LensFlareIntensity = true;
|
||||
PostProcessSettings.LensFlareIntensity = 0.1;
|
||||
CaptureComponent2D.bUseRayTracingIfEnabled = true;
|
||||
// Lumen
|
||||
PostProcessSettings.bOverride_DynamicGlobalIlluminationMethod = true;
|
||||
PostProcessSettings.DynamicGlobalIlluminationMethod = EDynamicGlobalIlluminationMethod::Lumen;
|
||||
PostProcessSettings.bOverride_LumenSceneLightingQuality = true;
|
||||
PostProcessSettings.LumenSceneLightingQuality = 1.0f;
|
||||
PostProcessSettings.bOverride_LumenSceneDetail = true;
|
||||
PostProcessSettings.LumenSceneDetail = 1.0f;
|
||||
PostProcessSettings.bOverride_LumenSceneViewDistance = true;
|
||||
PostProcessSettings.LumenSceneViewDistance = 20000.0f;
|
||||
PostProcessSettings.bOverride_LumenFinalGatherQuality = true;
|
||||
PostProcessSettings.LumenFinalGatherQuality = 1.0f;
|
||||
PostProcessSettings.bOverride_LumenMaxTraceDistance = true;
|
||||
PostProcessSettings.LumenMaxTraceDistance = 20000.0f;
|
||||
PostProcessSettings.bOverride_LumenSurfaceCacheResolution = true;
|
||||
PostProcessSettings.LumenSurfaceCacheResolution = 1.0f;
|
||||
PostProcessSettings.bOverride_LumenSceneLightingUpdateSpeed = true;
|
||||
PostProcessSettings.LumenSceneLightingUpdateSpeed = 1.0f;
|
||||
PostProcessSettings.bOverride_LumenFinalGatherLightingUpdateSpeed = true;
|
||||
PostProcessSettings.LumenFinalGatherLightingUpdateSpeed = 1.0f;
|
||||
PostProcessSettings.bOverride_LumenDiffuseColorBoost = true;
|
||||
PostProcessSettings.LumenDiffuseColorBoost = 1.0f;
|
||||
PostProcessSettings.bOverride_LumenSkylightLeaking = true;
|
||||
PostProcessSettings.LumenSkylightLeaking = 0.0f;
|
||||
PostProcessSettings.bOverride_LumenFullSkylightLeakingDistance = true;
|
||||
PostProcessSettings.LumenFullSkylightLeakingDistance = 1000.0f;
|
||||
PostProcessSettings.bOverride_ReflectionMethod = true;
|
||||
PostProcessSettings.ReflectionMethod = EReflectionMethod::Lumen;
|
||||
PostProcessSettings.bOverride_LumenReflectionQuality = true;
|
||||
PostProcessSettings.LumenReflectionQuality = 1.0f;
|
||||
PostProcessSettings.bOverride_LumenRayLightingMode = true;
|
||||
PostProcessSettings.LumenRayLightingMode = ELumenRayLightingModeOverride::Default;
|
||||
PostProcessSettings.bOverride_LumenFrontLayerTranslucencyReflections = true;
|
||||
PostProcessSettings.LumenFrontLayerTranslucencyReflections = false;
|
||||
PostProcessSettings.bOverride_LumenMaxReflectionBounces = true;
|
||||
PostProcessSettings.LumenMaxReflectionBounces = 1;
|
||||
}
|
||||
|
||||
// Remove the show flags that might interfere with post-processing effects
|
||||
// like depth and semantic segmentation.
|
||||
static void ConfigureShowFlags(FEngineShowFlags &ShowFlags, bool bPostProcessing)
|
||||
{
|
||||
if (bPostProcessing)
|
||||
{
|
||||
ShowFlags.EnableAdvancedFeatures();
|
||||
ShowFlags.SetMotionBlur(true);
|
||||
return;
|
||||
}
|
||||
|
||||
ShowFlags.SetAmbientOcclusion(false);
|
||||
ShowFlags.SetAntiAliasing(false);
|
||||
ShowFlags.SetVolumetricFog(false);
|
||||
// ShowFlags.SetAtmosphericFog(false);
|
||||
// ShowFlags.SetAudioRadius(false);
|
||||
// ShowFlags.SetBillboardSprites(false);
|
||||
ShowFlags.SetBloom(false);
|
||||
// ShowFlags.SetBounds(false);
|
||||
// ShowFlags.SetBrushes(false);
|
||||
// ShowFlags.SetBSP(false);
|
||||
// ShowFlags.SetBSPSplit(false);
|
||||
// ShowFlags.SetBSPTriangles(false);
|
||||
// ShowFlags.SetBuilderBrush(false);
|
||||
// ShowFlags.SetCameraAspectRatioBars(false);
|
||||
// ShowFlags.SetCameraFrustums(false);
|
||||
ShowFlags.SetCameraImperfections(false);
|
||||
ShowFlags.SetCameraInterpolation(false);
|
||||
// ShowFlags.SetCameraSafeFrames(false);
|
||||
// ShowFlags.SetCollision(false);
|
||||
// ShowFlags.SetCollisionPawn(false);
|
||||
// ShowFlags.SetCollisionVisibility(false);
|
||||
ShowFlags.SetColorGrading(false);
|
||||
// ShowFlags.SetCompositeEditorPrimitives(false);
|
||||
// ShowFlags.SetConstraints(false);
|
||||
// ShowFlags.SetCover(false);
|
||||
// ShowFlags.SetDebugAI(false);
|
||||
// ShowFlags.SetDecals(false);
|
||||
// ShowFlags.SetDeferredLighting(false);
|
||||
ShowFlags.SetDepthOfField(false);
|
||||
ShowFlags.SetDiffuse(false);
|
||||
ShowFlags.SetDirectionalLights(false);
|
||||
ShowFlags.SetDirectLighting(false);
|
||||
// ShowFlags.SetDistanceCulledPrimitives(false);
|
||||
// ShowFlags.SetDistanceFieldAO(false);
|
||||
// ShowFlags.SetDistanceFieldGI(false);
|
||||
ShowFlags.SetDynamicShadows(false);
|
||||
// ShowFlags.SetEditor(false);
|
||||
ShowFlags.SetEyeAdaptation(false);
|
||||
ShowFlags.SetFog(false);
|
||||
// ShowFlags.SetGame(false);
|
||||
// ShowFlags.SetGameplayDebug(false);
|
||||
// ShowFlags.SetGBufferHints(false);
|
||||
ShowFlags.SetGlobalIllumination(false);
|
||||
ShowFlags.SetGrain(false);
|
||||
// ShowFlags.SetGrid(false);
|
||||
// ShowFlags.SetHighResScreenshotMask(false);
|
||||
// ShowFlags.SetHitProxies(false);
|
||||
ShowFlags.SetHLODColoration(false);
|
||||
ShowFlags.SetHMDDistortion(false);
|
||||
// ShowFlags.SetIndirectLightingCache(false);
|
||||
// ShowFlags.SetInstancedFoliage(false);
|
||||
// ShowFlags.SetInstancedGrass(false);
|
||||
// ShowFlags.SetInstancedStaticMeshes(false);
|
||||
// ShowFlags.SetLandscape(false);
|
||||
// ShowFlags.SetLargeVertices(false);
|
||||
ShowFlags.SetLensFlares(false);
|
||||
ShowFlags.SetLevelColoration(false);
|
||||
ShowFlags.SetLightComplexity(false);
|
||||
ShowFlags.SetLightFunctions(false);
|
||||
ShowFlags.SetLightInfluences(false);
|
||||
ShowFlags.SetLighting(false);
|
||||
ShowFlags.SetLightMapDensity(false);
|
||||
ShowFlags.SetLightRadius(false);
|
||||
ShowFlags.SetLightShafts(false);
|
||||
// ShowFlags.SetLOD(false);
|
||||
ShowFlags.SetLODColoration(false);
|
||||
// ShowFlags.SetMaterials(false);
|
||||
// ShowFlags.SetMaterialTextureScaleAccuracy(false);
|
||||
// ShowFlags.SetMeshEdges(false);
|
||||
// ShowFlags.SetMeshUVDensityAccuracy(false);
|
||||
// ShowFlags.SetModeWidgets(false);
|
||||
ShowFlags.SetMotionBlur(false);
|
||||
// ShowFlags.SetNavigation(false);
|
||||
ShowFlags.SetOnScreenDebug(false);
|
||||
// ShowFlags.SetOutputMaterialTextureScales(false);
|
||||
// ShowFlags.SetOverrideDiffuseAndSpecular(false);
|
||||
// ShowFlags.SetPaper2DSprites(false);
|
||||
ShowFlags.SetParticles(false);
|
||||
// ShowFlags.SetPivot(false);
|
||||
ShowFlags.SetPointLights(false);
|
||||
// ShowFlags.SetPostProcessing(false);
|
||||
// ShowFlags.SetPostProcessMaterial(false);
|
||||
// ShowFlags.SetPrecomputedVisibility(false);
|
||||
// ShowFlags.SetPrecomputedVisibilityCells(false);
|
||||
// ShowFlags.SetPreviewShadowsIndicator(false);
|
||||
// ShowFlags.SetPrimitiveDistanceAccuracy(false);
|
||||
ShowFlags.SetPropertyColoration(false);
|
||||
// ShowFlags.SetQuadOverdraw(false);
|
||||
// ShowFlags.SetReflectionEnvironment(false);
|
||||
// ShowFlags.SetReflectionOverride(false);
|
||||
ShowFlags.SetRefraction(false);
|
||||
// ShowFlags.SetRendering(false);
|
||||
ShowFlags.SetSceneColorFringe(false);
|
||||
// ShowFlags.SetScreenPercentage(false);
|
||||
ShowFlags.SetScreenSpaceAO(false);
|
||||
ShowFlags.SetScreenSpaceReflections(false);
|
||||
// ShowFlags.SetSelection(false);
|
||||
// ShowFlags.SetSelectionOutline(false);
|
||||
// ShowFlags.SetSeparateTranslucency(false);
|
||||
// ShowFlags.SetShaderComplexity(false);
|
||||
// ShowFlags.SetShaderComplexityWithQuadOverdraw(false);
|
||||
// ShowFlags.SetShadowFrustums(false);
|
||||
// ShowFlags.SetSkeletalMeshes(false);
|
||||
// ShowFlags.SetSkinCache(false);
|
||||
ShowFlags.SetSkyLighting(false);
|
||||
// ShowFlags.SetSnap(false);
|
||||
// ShowFlags.SetSpecular(false);
|
||||
// ShowFlags.SetSplines(false);
|
||||
ShowFlags.SetSpotLights(false);
|
||||
// ShowFlags.SetStaticMeshes(false);
|
||||
ShowFlags.SetStationaryLightOverlap(false);
|
||||
// ShowFlags.SetStereoRendering(false);
|
||||
// ShowFlags.SetStreamingBounds(false);
|
||||
ShowFlags.SetSubsurfaceScattering(false);
|
||||
// ShowFlags.SetTemporalAA(false);
|
||||
// ShowFlags.SetTessellation(false);
|
||||
// ShowFlags.SetTestImage(false);
|
||||
// ShowFlags.SetTextRender(false);
|
||||
// ShowFlags.SetTexturedLightProfiles(false);
|
||||
ShowFlags.SetTonemapper(false);
|
||||
// ShowFlags.SetTranslucency(false);
|
||||
// ShowFlags.SetVectorFields(false);
|
||||
// ShowFlags.SetVertexColors(false);
|
||||
// ShowFlags.SetVignette(false);
|
||||
// ShowFlags.SetVisLog(false);
|
||||
// ShowFlags.SetVisualizeAdaptiveDOF(false);
|
||||
// ShowFlags.SetVisualizeBloom(false);
|
||||
ShowFlags.SetVisualizeBuffer(false);
|
||||
ShowFlags.SetVisualizeDistanceFieldAO(false);
|
||||
ShowFlags.SetVisualizeDOF(false);
|
||||
ShowFlags.SetVisualizeHDR(false);
|
||||
ShowFlags.SetVisualizeLightCulling(false);
|
||||
ShowFlags.SetVisualizeMeshDistanceFields(false);
|
||||
ShowFlags.SetVisualizeMotionBlur(false);
|
||||
ShowFlags.SetVisualizeOutOfBoundsPixels(false);
|
||||
ShowFlags.SetVisualizeSenses(false);
|
||||
ShowFlags.SetVisualizeShadingModels(false);
|
||||
ShowFlags.SetVisualizeSSR(false);
|
||||
ShowFlags.SetVisualizeSSS(false);
|
||||
// ShowFlags.SetVolumeLightingSamples(false);
|
||||
// ShowFlags.SetVolumes(false);
|
||||
// ShowFlags.SetWidgetComponents(false);
|
||||
// ShowFlags.SetWireframe(false);
|
||||
}
|
||||
|
||||
} // namespace SceneCaptureSensor_local_ns
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
#include "Carla/Sensor/Sensor.h"
|
||||
#include "Carla/Sensor/UE4_Overridden/SceneCaptureComponent2D_CARLA.h"
|
||||
#include "Carla/Sensor/ImageUtil.h"
|
||||
#include "Carla/Sensor/PostProcessConfig.h"
|
||||
|
||||
#include "Async/Async.h"
|
||||
|
||||
|
@ -115,9 +116,6 @@ struct FCameraGBufferFloat
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// Base class for sensors using a USceneCaptureComponent2D for rendering the
|
||||
/// scene. This class does not capture data, use
|
||||
/// `FPixelReader::SendPixelsInRenderThread<FColor>(*this)` in derived classes.
|
||||
|
@ -369,6 +367,9 @@ public:
|
|||
UFUNCTION(BlueprintCallable)
|
||||
float GetChromAberrOffset() const;
|
||||
|
||||
virtual void UpdatePostProcessConfig(
|
||||
FPostProcessConfig& InOutPostProcessConfig);
|
||||
|
||||
/// Use for debugging purposes only.
|
||||
UFUNCTION(BlueprintCallable)
|
||||
bool ReadPixels(TArray<FColor> &BitMap) const
|
||||
|
@ -443,11 +444,11 @@ protected:
|
|||
virtual void SetUpSceneCaptureComponent(USceneCaptureComponent2D &SceneCapture) {}
|
||||
|
||||
/// Render target necessary for scene capture.
|
||||
UPROPERTY(EditAnywhere)
|
||||
UPROPERTY(VisibleAnywhere)
|
||||
UTextureRenderTarget2D *CaptureRenderTarget = nullptr;
|
||||
|
||||
/// Scene capture component.
|
||||
UPROPERTY(EditAnywhere)
|
||||
UPROPERTY(VisibleAnywhere)
|
||||
USceneCaptureComponent2D_CARLA *CaptureComponent2D = nullptr;
|
||||
|
||||
UPROPERTY(EditAnywhere)
|
||||
|
|
|
@ -11,6 +11,12 @@
|
|||
#include "Components/SceneCaptureComponent2D.h"
|
||||
#include "Actor/ActorBlueprintFunctionLibrary.h"
|
||||
|
||||
AShaderBasedSensor::AShaderBasedSensor(const FObjectInitializer& ObjectInitializer)
|
||||
: Super(ObjectInitializer)
|
||||
{
|
||||
EnablePostProcessingEffects(false);
|
||||
}
|
||||
|
||||
bool AShaderBasedSensor::AddPostProcessingMaterial(const FString &Path)
|
||||
{
|
||||
ConstructorHelpers::FObjectFinder<UMaterial> Loader(*Path);
|
||||
|
|
|
@ -51,11 +51,7 @@ class CARLA_API AShaderBasedSensor : public ASceneCaptureSensor
|
|||
|
||||
public:
|
||||
|
||||
AShaderBasedSensor(const FObjectInitializer &ObjectInitializer)
|
||||
: Super(ObjectInitializer)
|
||||
{
|
||||
EnablePostProcessingEffects(false);
|
||||
}
|
||||
AShaderBasedSensor(const FObjectInitializer &ObjectInitializer);
|
||||
|
||||
void Set(const FActorDescription &ActorDescription) override;
|
||||
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
#include "Sky.h"
|
||||
#include "Components/PostProcessComponent.h"
|
||||
#include "Components/ExponentialHeightFogComponent.h"
|
||||
#include "Components/DirectionalLightComponent.h"
|
||||
#include "Components/DirectionalLightComponent.h"
|
||||
#include "Components/SkyLightComponent.h"
|
||||
#include "Components/VolumetricCloudComponent.h"
|
||||
#include "Components/SkyAtmosphereComponent.h"
|
||||
|
||||
|
||||
ASkyBase::ASkyBase(
|
||||
const FObjectInitializer& ObjectInitializer) :
|
||||
Super(ObjectInitializer),
|
||||
PostProcessComponent(nullptr),
|
||||
ExponentialHeightFogComponent(nullptr),
|
||||
DirectionalLightComponentSun(nullptr),
|
||||
DirectionalLightComponentMoon(nullptr),
|
||||
SkyLightComponent(nullptr),
|
||||
VolumetricCloudComponent(nullptr),
|
||||
SkyAtmosphereComponent(nullptr)
|
||||
{
|
||||
PostProcessComponent = CreateDefaultSubobject<UPostProcessComponent>("PostProcessComponent");
|
||||
ExponentialHeightFogComponent = CreateDefaultSubobject<UExponentialHeightFogComponent>("ExponentialHeightFogComponent");
|
||||
DirectionalLightComponentSun = CreateDefaultSubobject<UDirectionalLightComponent>("DirectionalLightComponentSun");
|
||||
DirectionalLightComponentMoon = CreateDefaultSubobject<UDirectionalLightComponent>("DirectionalLightComponentMoon");
|
||||
SkyLightComponent = CreateDefaultSubobject<USkyLightComponent>("SkyLightComponent");
|
||||
VolumetricCloudComponent = CreateDefaultSubobject<UVolumetricCloudComponent>("VolumetricCloudComponent");
|
||||
SkyAtmosphereComponent = CreateDefaultSubobject<USkyAtmosphereComponent>("SkyAtmosphereComponent");
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
#pragma once
|
||||
#include "GameFramework/Actor.h"
|
||||
#include "Sky.generated.h"
|
||||
|
||||
class UPostProcessComponent;
|
||||
class UExponentialHeightFogComponent;
|
||||
class UDirectionalLightComponent;
|
||||
class USkyLightComponent;
|
||||
class UVolumetricCloudComponent;
|
||||
class USkyAtmosphereComponent;
|
||||
|
||||
UCLASS(Abstract)
|
||||
class CARLA_API ASkyBase :
|
||||
public AActor
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
|
||||
ASkyBase(const FObjectInitializer& ObjectInitializer);
|
||||
|
||||
protected:
|
||||
|
||||
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Components")
|
||||
UPostProcessComponent* PostProcessComponent;
|
||||
|
||||
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Components")
|
||||
UExponentialHeightFogComponent* ExponentialHeightFogComponent;
|
||||
|
||||
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Components")
|
||||
UDirectionalLightComponent* DirectionalLightComponentSun;
|
||||
|
||||
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Components")
|
||||
UDirectionalLightComponent* DirectionalLightComponentMoon;
|
||||
|
||||
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Components")
|
||||
USkyLightComponent* SkyLightComponent;
|
||||
|
||||
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Components")
|
||||
UVolumetricCloudComponent* VolumetricCloudComponent;
|
||||
|
||||
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Components")
|
||||
USkyAtmosphereComponent* SkyAtmosphereComponent;
|
||||
|
||||
|
||||
};
|
Loading…
Reference in New Issue