From 78c75648356a4eae8fec2a842a48fb0f5255f3d2 Mon Sep 17 00:00:00 2001 From: Marc Garcia Puig Date: Thu, 17 Sep 2020 15:40:52 +0200 Subject: [PATCH] Updated ExposureCompensation --- .../Carla/Actor/ActorBlueprintFunctionLibrary.cpp | 4 ++-- .../Source/Carla/Sensor/SceneCaptureSensor.cpp | 14 ++++++++++---- Util/BuildTools/BuildCarlaUE4.sh | 2 +- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Actor/ActorBlueprintFunctionLibrary.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Actor/ActorBlueprintFunctionLibrary.cpp index ffb898830..629e4591b 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Actor/ActorBlueprintFunctionLibrary.cpp +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Actor/ActorBlueprintFunctionLibrary.cpp @@ -441,7 +441,7 @@ void UActorBlueprintFunctionLibrary::MakeCameraDefinition( FActorVariation ExposureCompensation; ExposureCompensation.Id = TEXT("exposure_compensation"); ExposureCompensation.Type = EActorAttributeType::Float; - ExposureCompensation.RecommendedValues = { TEXT("-1.8") }; + ExposureCompensation.RecommendedValues = { TEXT("0.0") }; ExposureCompensation.bRestrictToRecommended = false; // - Manual ------------------------------------------------ @@ -1399,7 +1399,7 @@ void UActorBlueprintFunctionLibrary::SetCamera( Camera->SetExposureMethod(EAutoExposureMethod::AEM_Manual); } Camera->SetExposureCompensation( - RetrieveActorAttributeToFloat("exposure_compensation", Description.Variations, -1.8f)); + RetrieveActorAttributeToFloat("exposure_compensation", Description.Variations, 0.0f)); Camera->SetShutterSpeed( RetrieveActorAttributeToFloat("shutter_speed", Description.Variations, 200.0f)); Camera->SetISO( diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/SceneCaptureSensor.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/SceneCaptureSensor.cpp index 549511bba..798baf228 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/SceneCaptureSensor.cpp +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/SceneCaptureSensor.cpp @@ -110,12 +110,12 @@ EAutoExposureMethod ASceneCaptureSensor::GetExposureMethod() const void ASceneCaptureSensor::SetExposureCompensation(float Compensation) { check(CaptureComponent2D != nullptr); - // Looks like windows and linux have different outputs with the - // same exposure compensation #if PLATFORM_LINUX - CaptureComponent2D->PostProcessSettings.AutoExposureBias = Compensation; + // Looks like Windows and Linux have different outputs with the + // same exposure compensation, this fixes it. + CaptureComponent2D->PostProcessSettings.AutoExposureBias = Compensation - 1.5f; #else - CaptureComponent2D->PostProcessSettings.AutoExposureBias = Compensation + 1.8f; + CaptureComponent2D->PostProcessSettings.AutoExposureBias = Compensation; #endif } @@ -563,6 +563,12 @@ namespace SceneCaptureSensor_local_ns { // 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.5f, 1.5f, 1.5f, 1.0f); +#endif // Chromatic Aberration PostProcessSettings.bOverride_SceneFringeIntensity = true; diff --git a/Util/BuildTools/BuildCarlaUE4.sh b/Util/BuildTools/BuildCarlaUE4.sh index 56a734ca3..fbf682993 100755 --- a/Util/BuildTools/BuildCarlaUE4.sh +++ b/Util/BuildTools/BuildCarlaUE4.sh @@ -120,7 +120,7 @@ if ${BUILD_CARLAUE4} ; then # This command fails sometimes but normally we can continue anyway. set +e log "Generate Unreal project files." - ${UE4_ROOT}/GenerateProjectFiles.sh -project="${PWD}/CarlaUE4.uproject" -game -engine -makefiles + ${UE4_ROOT}/GenerateProjectFiles.sh -project="${PWD}/CarlaUE4.uproject" -game -engine -makefile set -e fi