#include "Render/DescentLamps.h" #include "Core/Tuning/DescentTune_Look.h" #include "DescentUnits.h" #include "Components/SpotLightComponent.h" namespace LTune = Descent::Tune::Look; namespace Descent::Look { void ConfigureSpot(USpotLightComponent* L, ELamp Kind, double IntensityScale) { if (!L) { return; } double Radius, Inner, Outer, Intensity, Scatter; FLinearColor Color; if (Kind == ELamp::TenderHeadlamp) { Radius = LTune::TenderLampRadiusM; Inner = LTune::TenderLampInnerDeg; Outer = LTune::TenderLampOuterDeg; Intensity = LTune::TenderLampIntensity; Scatter = LTune::TenderLampScatter; Color = FLinearColor::FromSRGBColor(FColor::FromHex(TEXT("e6f6ff"))); } else { Radius = LTune::FlashlightRadiusM; Inner = LTune::FlashlightInnerDeg; Outer = LTune::FlashlightOuterDeg; Intensity = LTune::FlashlightIntensity; Scatter = LTune::FlashlightScatter; Color = FLinearColor::FromSRGBColor(FColor::FromHex(TEXT("fff2dc"))); } L->SetMobility(EComponentMobility::Movable); L->bUseInverseSquaredFalloff = false; L->SetLightFalloffExponent(LTune::LightFalloffExponent); L->SetAttenuationRadius(static_cast(Descent::MetresToUU(Radius))); L->SetInnerConeAngle(static_cast(Inner)); L->SetOuterConeAngle(static_cast(Outer)); L->SetLightColor(Color); L->SetIntensity(static_cast(Intensity * IntensityScale)); L->SetVolumetricScatteringIntensity(static_cast(Scatter)); L->SetCastShadows(true); L->SetSourceRadius(0.f); L->SetSoftSourceRadius(0.f); L->SetSourceLength(0.f); } }