Files
UnrealEngineUWP/Engine/Source/Runtime/AugmentedReality/Private/ARLightEstimate.cpp
Rolando Caloca 5b82f15def Copying //UE4/Dev-RenderPlat-Staging@11388153 to //UE4/Main
#rb none
#rnx

[CL 11388545 by Rolando Caloca in Main branch]
2020-02-12 13:27:19 -05:00

44 lines
1.3 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "ARLightEstimate.h"
//
//
//
void UARBasicLightEstimate::SetLightEstimate(float InAmbientIntensityLumens, float InColorTemperatureKelvin)
{
AmbientIntensityLumens = InAmbientIntensityLumens;
AmbientColorTemperatureKelvin = InColorTemperatureKelvin;
AmbientColor = FLinearColor::MakeFromColorTemperature(GetAmbientColorTemperatureKelvin());
}
void UARBasicLightEstimate::SetLightEstimate(FVector InRGBScaleFactor, float InPixelIntensity)
{
// Try to convert ARCore average pixel intensity to lumen and set the color tempature to pure white.
AmbientIntensityLumens = InPixelIntensity / 0.18f * 1000;
AmbientColor = FLinearColor(InRGBScaleFactor);
// TODO: Try to convert ambient color to color tempature?
}
void UARBasicLightEstimate::SetLightEstimate(float InColorTemperatureKelvin, FLinearColor InAmbientColor)
{
AmbientColorTemperatureKelvin = InColorTemperatureKelvin;
AmbientColor = InAmbientColor;
}
float UARBasicLightEstimate::GetAmbientIntensityLumens() const
{
return AmbientIntensityLumens;
}
float UARBasicLightEstimate::GetAmbientColorTemperatureKelvin() const
{
return AmbientColorTemperatureKelvin;
}
FLinearColor UARBasicLightEstimate::GetAmbientColor() const
{
return AmbientColor;
}