Do not change target capture gamma

This commit is contained in:
nsubiron 2017-10-19 16:44:43 +02:00
parent afdbf78816
commit 31bea41113
3 changed files with 3 additions and 21 deletions

View File

@ -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);
}
}

View File

@ -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<ASceneCaptureCamera>(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);

View File

@ -79,8 +79,7 @@ public:
void AddSceneCaptureCamera(
const FCameraDescription &CameraDescription,
const FCameraPostProcessParameters *OverridePostProcessParameters,
float TargetGamma);
const FCameraPostProcessParameters *OverridePostProcessParameters);
/// @}
// ===========================================================================