diff --git a/Source/Carla/Game/CarlaGameModeBase.cpp b/Source/Carla/Game/CarlaGameModeBase.cpp index 172312c9c..878fd3578 100644 --- a/Source/Carla/Game/CarlaGameModeBase.cpp +++ b/Source/Carla/Game/CarlaGameModeBase.cpp @@ -204,19 +204,6 @@ void ACarlaGameModeBase::RegisterPlayer(AController &NewPlayer) AttachCaptureCamerasToPlayer(); } -static float GetPlayerDisplayGamma(const APlayerCameraManager *PlayerCameraManager) -{ - if (PlayerCameraManager == nullptr) { - return 0.0f; - } - UGameViewportClient* ViewportClient = PlayerCameraManager->PCOwner->GetLocalPlayer()->ViewportClient; - if (ViewportClient == nullptr) { - return 0.0f; - } - FSceneViewport* SceneViewport = ViewportClient->GetGameViewport(); - return SceneViewport ? SceneViewport->GetDisplayGamma() : 0.0f; -} - void ACarlaGameModeBase::AttachCaptureCamerasToPlayer() { if (PlayerController == nullptr) { @@ -230,10 +217,8 @@ void ACarlaGameModeBase::AttachCaptureCamerasToPlayer() OverridePostProcessParameters = &Weather->CameraPostProcessParameters; } - const float TargetGamma = GetPlayerDisplayGamma(PlayerController->PlayerCameraManager); - for (const auto &Item : Settings.CameraDescriptions) { - PlayerController->AddSceneCaptureCamera(Item.Value, OverridePostProcessParameters, TargetGamma); + PlayerController->AddSceneCaptureCamera(Item.Value, OverridePostProcessParameters); } } diff --git a/Source/Carla/Game/CarlaVehicleController.cpp b/Source/Carla/Game/CarlaVehicleController.cpp index c9037d36a..9dddfdcb4 100644 --- a/Source/Carla/Game/CarlaVehicleController.cpp +++ b/Source/Carla/Game/CarlaVehicleController.cpp @@ -110,8 +110,7 @@ void ACarlaVehicleController::Tick(float DeltaTime) void ACarlaVehicleController::AddSceneCaptureCamera( const FCameraDescription &Description, - const FCameraPostProcessParameters *OverridePostProcessParameters, - const float TargetGamma) + const FCameraPostProcessParameters *OverridePostProcessParameters) { auto Camera = GetWorld()->SpawnActor(Description.Position, Description.Rotation); if (OverridePostProcessParameters != nullptr) { @@ -119,7 +118,6 @@ void ACarlaVehicleController::AddSceneCaptureCamera( } else { Camera->Set(Description); } - Camera->SetTargetGamma(TargetGamma); Camera->AttachToActor(GetPawn(), FAttachmentTransformRules::KeepRelativeTransform); Camera->SetOwner(GetPawn()); AddTickPrerequisiteActor(Camera); diff --git a/Source/Carla/Game/CarlaVehicleController.h b/Source/Carla/Game/CarlaVehicleController.h index 1d77c4fbf..b81ff4555 100644 --- a/Source/Carla/Game/CarlaVehicleController.h +++ b/Source/Carla/Game/CarlaVehicleController.h @@ -79,8 +79,7 @@ public: void AddSceneCaptureCamera( const FCameraDescription &CameraDescription, - const FCameraPostProcessParameters *OverridePostProcessParameters, - float TargetGamma); + const FCameraPostProcessParameters *OverridePostProcessParameters); /// @} // ===========================================================================