Fixed histogram exposure mode

This commit is contained in:
Marc Garcia Puig 2020-09-16 15:43:15 +02:00
parent 1139d679b1
commit 788f9e33f7
3 changed files with 12 additions and 11 deletions

View File

@ -33,6 +33,7 @@ r.DistanceFieldBuild.EightBit=False
r.DistanceFieldBuild.Compress=False r.DistanceFieldBuild.Compress=False
r.DistanceFields.AtlasSizeXY=1024 r.DistanceFields.AtlasSizeXY=1024
r.DistanceFields.AtlasSizeZ=2048 r.DistanceFields.AtlasSizeZ=2048
r.DefaultFeature.AutoExposure.ExtendDefaultLuminanceRange=True
[/Script/AIModule.AISense_Sight] [/Script/AIModule.AISense_Sight]
bAutoRegisterAllPawnsAsSources=False bAutoRegisterAllPawnsAsSources=False

View File

@ -441,7 +441,7 @@ void UActorBlueprintFunctionLibrary::MakeCameraDefinition(
FActorVariation ExposureCompensation; FActorVariation ExposureCompensation;
ExposureCompensation.Id = TEXT("exposure_compensation"); ExposureCompensation.Id = TEXT("exposure_compensation");
ExposureCompensation.Type = EActorAttributeType::Float; ExposureCompensation.Type = EActorAttributeType::Float;
ExposureCompensation.RecommendedValues = { TEXT("-2.2") }; ExposureCompensation.RecommendedValues = { TEXT("-1.8") };
ExposureCompensation.bRestrictToRecommended = false; ExposureCompensation.bRestrictToRecommended = false;
// - Manual ------------------------------------------------ // - Manual ------------------------------------------------
@ -468,7 +468,7 @@ void UActorBlueprintFunctionLibrary::MakeCameraDefinition(
FActorVariation Aperture; // N FActorVariation Aperture; // N
Aperture.Id = TEXT("fstop"); Aperture.Id = TEXT("fstop");
Aperture.Type = EActorAttributeType::Float; Aperture.Type = EActorAttributeType::Float;
Aperture.RecommendedValues = { TEXT("8.0") }; Aperture.RecommendedValues = { TEXT("1.4") };
Aperture.bRestrictToRecommended = false; Aperture.bRestrictToRecommended = false;
// - Histogram --------------------------------------------- // - Histogram ---------------------------------------------
@ -478,7 +478,7 @@ void UActorBlueprintFunctionLibrary::MakeCameraDefinition(
FActorVariation ExposureMinBright; FActorVariation ExposureMinBright;
ExposureMinBright.Id = TEXT("exposure_min_bright"); ExposureMinBright.Id = TEXT("exposure_min_bright");
ExposureMinBright.Type = EActorAttributeType::Float; ExposureMinBright.Type = EActorAttributeType::Float;
ExposureMinBright.RecommendedValues = { TEXT("0.1") }; ExposureMinBright.RecommendedValues = { TEXT("7.0") };
ExposureMinBright.bRestrictToRecommended = false; ExposureMinBright.bRestrictToRecommended = false;
// The maximum brightness for auto exposure that limits the upper // The maximum brightness for auto exposure that limits the upper
@ -486,7 +486,7 @@ void UActorBlueprintFunctionLibrary::MakeCameraDefinition(
FActorVariation ExposureMaxBright; FActorVariation ExposureMaxBright;
ExposureMaxBright.Id = TEXT("exposure_max_bright"); ExposureMaxBright.Id = TEXT("exposure_max_bright");
ExposureMaxBright.Type = EActorAttributeType::Float; ExposureMaxBright.Type = EActorAttributeType::Float;
ExposureMaxBright.RecommendedValues = { TEXT("2.0") }; ExposureMaxBright.RecommendedValues = { TEXT("20.0") };
ExposureMaxBright.bRestrictToRecommended = false; ExposureMaxBright.bRestrictToRecommended = false;
// The speed at which the adaptation occurs from a dark environment // The speed at which the adaptation occurs from a dark environment
@ -1389,8 +1389,8 @@ void UActorBlueprintFunctionLibrary::SetCamera(
RetrieveActorAttributeToFloat("lens_flare_intensity", Description.Variations, 0.1f)); RetrieveActorAttributeToFloat("lens_flare_intensity", Description.Variations, 0.1f));
Camera->SetBloomIntensity( Camera->SetBloomIntensity(
RetrieveActorAttributeToFloat("bloom_intensity", Description.Variations, 0.675f)); RetrieveActorAttributeToFloat("bloom_intensity", Description.Variations, 0.675f));
// Exposure // Exposure, histogram mode by default
if (RetrieveActorAttributeToString("exposure_mode", Description.Variations, "manual") == "histogram") if (RetrieveActorAttributeToString("exposure_mode", Description.Variations, "histogram") == "histogram")
{ {
Camera->SetExposureMethod(EAutoExposureMethod::AEM_Histogram); Camera->SetExposureMethod(EAutoExposureMethod::AEM_Histogram);
} }
@ -1399,18 +1399,18 @@ void UActorBlueprintFunctionLibrary::SetCamera(
Camera->SetExposureMethod(EAutoExposureMethod::AEM_Manual); Camera->SetExposureMethod(EAutoExposureMethod::AEM_Manual);
} }
Camera->SetExposureCompensation( Camera->SetExposureCompensation(
RetrieveActorAttributeToFloat("exposure_compensation", Description.Variations, -2.2f)); RetrieveActorAttributeToFloat("exposure_compensation", Description.Variations, -1.8f));
Camera->SetShutterSpeed( Camera->SetShutterSpeed(
RetrieveActorAttributeToFloat("shutter_speed", Description.Variations, 200.0f)); RetrieveActorAttributeToFloat("shutter_speed", Description.Variations, 200.0f));
Camera->SetISO( Camera->SetISO(
RetrieveActorAttributeToFloat("iso", Description.Variations, 200.0f)); RetrieveActorAttributeToFloat("iso", Description.Variations, 200.0f));
Camera->SetAperture( Camera->SetAperture(
RetrieveActorAttributeToFloat("fstop", Description.Variations, 8.0f)); RetrieveActorAttributeToFloat("fstop", Description.Variations, 1.4f));
Camera->SetExposureMinBrightness( Camera->SetExposureMinBrightness(
RetrieveActorAttributeToFloat("exposure_min_bright", Description.Variations, 0.1f)); RetrieveActorAttributeToFloat("exposure_min_bright", Description.Variations, 7.0f));
Camera->SetExposureMaxBrightness( Camera->SetExposureMaxBrightness(
RetrieveActorAttributeToFloat("exposure_max_bright", Description.Variations, 2.0f)); RetrieveActorAttributeToFloat("exposure_max_bright", Description.Variations, 20.0f));
Camera->SetExposureSpeedUp( Camera->SetExposureSpeedUp(
RetrieveActorAttributeToFloat("exposure_speed_up", Description.Variations, 3.0f)); RetrieveActorAttributeToFloat("exposure_speed_up", Description.Variations, 3.0f));
Camera->SetExposureSpeedDown( Camera->SetExposureSpeedDown(

View File

@ -115,7 +115,7 @@ void ASceneCaptureSensor::SetExposureCompensation(float Compensation)
#if PLATFORM_LINUX #if PLATFORM_LINUX
CaptureComponent2D->PostProcessSettings.AutoExposureBias = Compensation; CaptureComponent2D->PostProcessSettings.AutoExposureBias = Compensation;
#else #else
CaptureComponent2D->PostProcessSettings.AutoExposureBias = Compensation + 2.2f; CaptureComponent2D->PostProcessSettings.AutoExposureBias = Compensation + 1.8f;
#endif #endif
} }