|
CARLA
|
#include <Weather.h>
Inheritance diagram for AWeather:Public Member Functions | |
| void | ApplyWeather (const FWeatherParameters &WeatherParameters) |
| Update the weather parameters and notifies it to the blueprint's event. | |
| AWeather (const FObjectInitializer &ObjectInitializer) | |
| uint64 | GetApplySerial () const |
| How many times ApplyWeather ran: Multi-GPU secondaries mirror every apply, also the ones that set the same values again. | |
| const FWeatherParameters & | GetCurrentWeather () const |
| Returns the current WeatherParameters. | |
| const bool & | GetDayNightCycle () const |
| Returns whether the day night cycle is active (automatic on/off switch when changin to night mode) | |
| void | NotifyWeather (ASensor *Sensor=nullptr) |
| Notifing the weather to the blueprint's event. | |
| void | SetDayNightCycle (const bool &active) |
| Update the day night cycle. | |
| void | SetWeather (const FWeatherParameters &WeatherParameters) |
| Update the weather parameters without notifing it to the blueprint's event. | |
Static Public Member Functions | |
| static void | ApplyWeatherToSkyActor (AActor *SkyActor, const FWeatherParameters &Weather) |
| Pushes Weather into a single ASkyBase rig (sun/fog/clouds/atmosphere/ exposure) and runs its blueprint refresh functions – everything PushWeatherToSky does per-actor, factored out so it works on any sky actor directly, without requiring an AWeather instance to exist in the world. | |
| static void | ClearSkyLightMap (UWorld *World) |
| Drops the override and restores the real-time atmosphere capture with the curve-driven intensity. | |
| static void | FillSkyPostProcessFallback (class UPostProcessComponent *PostProcessComponent) |
| Exposure / bloom defaults for the fields the sky's loaded camera profile does not set (see the comment in ApplyWeatherToSkyActor). | |
| static bool | HasSkyLightMap () |
| static bool | SetSkyLightMap (UWorld *World, class UTextureCube *Cubemap, float Intensity) |
| Environment-map override for the sky light (set_sky_light_map RPC): every ASkyBase rig in World switches its sky light to the given cubemap (SLS_SpecifiedCubemap, real-time capture off) at the given intensity, and ApplyWeatherToSkyActor keeps it that way across weather pushes until ClearSkyLightMap. | |
Protected Member Functions | |
| void | RefreshWeather (const FWeatherParameters &WeatherParameters) |
Private Member Functions | |
| virtual void | BeginPlay () override |
| void | CheckWeatherPostProcessEffects () |
| UParticleSystemComponent * | CreateRainEmitter (AActor *Owner, bool bSensor) |
| virtual void | EndPlay (const EEndPlayReason::Type EndPlayReason) override |
| void | PushWeatherToSky () |
| Push the current weather into the ASkyBase rig (BP_Carla_Sky) and run its blueprint Update. | |
| virtual void | Tick (float DeltaSeconds) override |
| void | UpdateRain () |
| void | UpdateStreetLightsForDayNight () |
| Broadcast the current day/night state (derived from SunAltitudeAngle) to UCarlaLightSubsystem so registered CarlaLight components (street lamps) react. | |
Private Attributes | |
| TMap< UMaterial *, float > | ActiveBlendables |
| uint64 | ApplySerial = 0u |
| bool | DayNightCycle = true |
| UMaterial * | DustStormPostProcessMaterial |
| UMaterial * | PrecipitationPostProcessMaterial |
| UCarlaRainCameraModifier * | RainCameraModifier = nullptr |
| class UMaterialParameterCollection * | RainParameters = nullptr |
| UParticleSystem * | RainTemplate = nullptr |
| TMap< TWeakObjectPtr< ASceneCaptureCamera >, TWeakObjectPtr< UParticleSystemComponent > > | SensorRain |
| UParticleSystemComponent * | ViewportRain = nullptr |
| FWeatherParameters | Weather |
| AWeather::AWeather | ( | const FObjectInitializer & | ObjectInitializer | ) |
Definition at line 1155 of file Weather.cpp.
References DustStormPostProcessMaterial, PrecipitationPostProcessMaterial, RainParameters, and RainTemplate.
| void AWeather::ApplyWeather | ( | const FWeatherParameters & | WeatherParameters | ) |
Update the weather parameters and notifies it to the blueprint's event.
Definition at line 2597 of file Weather.cpp.
References ACarlaRecorder::AddWeather(), ApplySerial, CheckWeatherPostProcessEffects(), CarlaRecorderWeather::Cloudiness, FWeatherParameters::Cloudiness, CarlaRecorderWeather::DustStorm, FWeatherParameters::DustStorm, CarlaRecorderWeather::FogDensity, FWeatherParameters::FogDensity, CarlaRecorderWeather::FogDistance, FWeatherParameters::FogDistance, CarlaRecorderWeather::FogFalloff, FWeatherParameters::FogFalloff, UCarlaStatics::GetRecorder(), ACarlaRecorder::IsEnabled(), CarlaRecorderWeather::MieScatteringScale, FWeatherParameters::MieScatteringScale, CarlaRecorderWeather::Precipitation, FWeatherParameters::Precipitation, CarlaRecorderWeather::PrecipitationDeposits, FWeatherParameters::PrecipitationDeposits, PushWeatherToSky(), CarlaRecorderWeather::RayleighScatteringScale, FWeatherParameters::RayleighScatteringScale, RefreshWeather(), CarlaRecorderWeather::ScatteringIntensity, FWeatherParameters::ScatteringIntensity, SetWeather(), CarlaRecorderWeather::SunAltitudeAngle, FWeatherParameters::SunAltitudeAngle, CarlaRecorderWeather::SunAzimuthAngle, FWeatherParameters::SunAzimuthAngle, UpdateRain(), UpdateStreetLightsForDayNight(), Weather, CarlaRecorderWeather::Wetness, FWeatherParameters::Wetness, CarlaRecorderWeather::WindIntensity, and FWeatherParameters::WindIntensity.
Referenced by ACarlaGameModeBase::BeginPlay(), and CarlaReplayerHelper::ProcessReplayerWeather().
|
static |
Pushes Weather into a single ASkyBase rig (sun/fog/clouds/atmosphere/ exposure) and runs its blueprint refresh functions – everything PushWeatherToSky does per-actor, factored out so it works on any sky actor directly, without requiring an AWeather instance to exist in the world.
Used by ASkyBase::RefreshWeather/LoadPreset for editor-time preview when no BP_CarlaWeather is placed in the level, and by PushWeatherToSky itself for the full runtime path.
Definition at line 1543 of file Weather.cpp.
References ApplyOvercastBlend(), ApplySunAltitudeFalloff(), FWeatherParameters::Cloudiness, ComputeCloudDeckFactor(), ComputeCloudDeckLightFactor(), ComputeMoonBlend(), ComputeMoonHaloBlend(), ComputeNightBlend(), ComputeOvercastNeutralTint(), ComputeSunTwilightFactor(), ComputeTwilightCloudScale(), CVarCarlaWeatherCityGlow(), CVarCarlaWeatherCityGlowColor(), CVarCarlaWeatherCloudShadowExtentKm(), CVarCarlaWeatherDeckCoverageExponent(), CVarCarlaWeatherDeckExtinctionScale(), CVarCarlaWeatherDeckGlow(), CVarCarlaWeatherDeckGlowColor(), CVarCarlaWeatherDeckNoiseExp(), CVarCarlaWeatherDeckWarpCount(), CVarCarlaWeatherDeckWarpSwitch(), CVarCarlaWeatherEnableOvercastClouds(), CVarCarlaWeatherFogDensityScale(), CVarCarlaWeatherMoonAtmosphereDisk(), CVarCarlaWeatherMoonIntensity(), CVarCarlaWeatherMoonMinAltitudeDeg(), CVarCarlaWeatherNightSkylightIntensity(), CVarCarlaWeatherOvercastAmbientNeutralize(), CVarCarlaWeatherOvercastSunIntensity(), CVarCarlaWeatherOvercastSunNeutralize(), CVarCarlaWeatherOvercastThreshold(), CVarCarlaWeatherRainDeckGlowScale(), CVarCarlaWeatherSkyLightIndirectIntensity(), CVarCarlaWeatherSkySphereCloudOpacity(), CVarCarlaWeatherSkySphereNightColor(), CVarCarlaWeatherSkySphereScale(), CVarCarlaWeatherSkySphereShowDeg(), CVarCarlaWeatherStarsBrightness(), CVarCarlaWeatherStreetLightsOnDeg(), CVarCarlaWeatherSunIndirectIntensity(), CVarCarlaWeatherSunTwilightEndDeg(), CVarCarlaWeatherSunTwilightStartDeg(), CVarCarlaWeatherTransmittanceMinElevationDeg(), CVarCarlaWeatherTransmittanceReleaseDeg(), FillSkyPostProcessFallback(), ASkyBase::FindWeatherParameters(), FWeatherParameters::FogDensity, FWeatherParameters::FogDistance, GetOvercastSkyLightTarget(), NoteLightingChange(), NoteSunRotation(), ParseColorCVar(), FWeatherParameters::Precipitation, RainDeckScale(), SampleCurvePeakAboveHorizon(), FWeatherParameters::SunAltitudeAngle, FWeatherParameters::SunAzimuthAngle, UpdateMoonDisc(), UpdateMoonHalo(), Weather, FWeatherParameters::Wetness, and FWeatherParameters::WindIntensity.
Referenced by ASkyBase::BeginPlay(), ASkyBase::OnConstruction(), and PushWeatherToSky().
|
overrideprivatevirtual |
Definition at line 1310 of file Weather.cpp.
|
private |
Definition at line 1334 of file Weather.cpp.
References ActiveBlendables, FWeatherParameters::DustStorm, DustStormPostProcessMaterial, ASceneCaptureSensor::GetCaptureComponent2D(), FWeatherParameters::Precipitation, PrecipitationPostProcessMaterial, and Weather.
Referenced by ApplyWeather(), and NotifyWeather().
|
static |
Drops the override and restores the real-time atmosphere capture with the curve-driven intensity.
Definition at line 1500 of file Weather.cpp.
References UCarlaStatics::GetCurrentEpisode(), and Weather.
Referenced by FCarlaServer::FPimpl::BindActions().
|
private |
|
overrideprivatevirtual |
Definition at line 1318 of file Weather.cpp.
References GLastPushedCloudiness, GLastPushedSunAltitude, IsValid(), RainCameraModifier, SensorRain, SetForceInvalidateDirectionalVSM(), and SetForceLightingUpdate().
|
static |
Exposure / bloom defaults for the fields the sky's loaded camera profile does not set (see the comment in ApplyWeatherToSkyActor).
Definition at line 2511 of file Weather.cpp.
References CVarCarlaWeatherBloomIntensity(), CVarCarlaWeatherExposureBias(), and CVarCarlaWeatherExposureMaxEV().
Referenced by ApplyWeatherToSkyActor(), and ASkyBase::BeginPlay().
|
inline |
|
inline |
Returns the current WeatherParameters.
Definition at line 59 of file Weather.h.
References Weather.
Referenced by ACarlaRecorder::AddExistingWeather(), and ACarlaGameModeBase::BeginPlay().
|
inline |
|
static |
Definition at line 1530 of file Weather.cpp.
Referenced by FCarlaServer::FPimpl::BindActions().
| void AWeather::NotifyWeather | ( | ASensor * | Sensor = nullptr | ) |
Notifing the weather to the blueprint's event.
Definition at line 2650 of file Weather.cpp.
References CheckWeatherPostProcessEffects().
Referenced by ASceneCaptureSensor::BeginPlay(), and ASceneCaptureSensor_WideAngleLens::BeginPlay().
|
private |
Push the current weather into the ASkyBase rig (BP_Carla_Sky) and run its blueprint Update.
The UE5 sky rig only refreshes itself from its construction script, so without this call the sun/fog/atmosphere stay frozen at the state saved in the map regardless of the weather API.
Definition at line 1535 of file Weather.cpp.
References ApplyWeatherToSkyActor(), and Weather.
Referenced by ApplyWeather().
|
protected |
Referenced by ApplyWeather().
| void AWeather::SetDayNightCycle | ( | const bool & | active | ) |
|
static |
Environment-map override for the sky light (set_sky_light_map RPC): every ASkyBase rig in World switches its sky light to the given cubemap (SLS_SpecifiedCubemap, real-time capture off) at the given intensity, and ApplyWeatherToSkyActor keeps it that way across weather pushes until ClearSkyLightMap.
Scoped to World: it is dropped when that world is cleaned up (load_world / reload_world), so the next level starts on its own real-time capture. The cubemap is rooted for as long as it is set. Returns false if no sky rig was found.
Definition at line 1465 of file Weather.cpp.
Referenced by FCarlaServer::FPimpl::BindActions().
| void AWeather::SetWeather | ( | const FWeatherParameters & | WeatherParameters | ) |
Update the weather parameters without notifing it to the blueprint's event.
Definition at line 2661 of file Weather.cpp.
References Weather.
Referenced by ApplyWeather().
|
overrideprivatevirtual |
Definition at line 1302 of file Weather.cpp.
References ReleaseDirectionalVSMInvalidateIfSunStill(), ReleaseLightingUpdateIfSettled(), and UpdateRain().
|
private |
Definition at line 1227 of file Weather.cpp.
References CreateRainEmitter(), IsValid(), FWeatherParameters::Precipitation, PrecipitationPostProcessMaterial, RainCameraModifier, UCarlaRainCameraModifier::RainMaterial, RainParameters, UCarlaRainCameraModifier::RainWeight, SensorRain, ViewportRain, Weather, and FWeatherParameters::WindIntensity.
Referenced by ApplyWeather(), and Tick().
|
private |
Broadcast the current day/night state (derived from SunAltitudeAngle) to UCarlaLightSubsystem so registered CarlaLight components (street lamps) react.
BP_CarlaWeather's graph does reference the subsystem and DayTimeChangeEvent, but measured behavior is that lights never receive it (same blueprint has other confirmed-dead exec chains that PushWeatherToSky already routes around) – drive it from C++ instead so it does not depend on that graph being reachable.
Definition at line 2580 of file Weather.cpp.
References CVarCarlaWeatherStreetLightsOnDeg(), DayNightCycle, UCarlaLightSubsystem::NotifyDayTimeChange(), UCarlaLightSubsystem::NumLights(), FWeatherParameters::SunAltitudeAngle, and Weather.
Referenced by ApplyWeather().
|
private |
Definition at line 168 of file Weather.h.
Referenced by CheckWeatherPostProcessEffects().
|
private |
Definition at line 173 of file Weather.h.
Referenced by ApplyWeather().
|
private |
Definition at line 171 of file Weather.h.
Referenced by SetDayNightCycle(), and UpdateStreetLightsForDayNight().
|
private |
Definition at line 166 of file Weather.h.
Referenced by AWeather(), and CheckWeatherPostProcessEffects().
|
private |
Definition at line 163 of file Weather.h.
Referenced by AWeather(), CheckWeatherPostProcessEffects(), and UpdateRain().
|
private |
Definition at line 139 of file Weather.h.
Referenced by EndPlay(), and UpdateRain().
|
private |
Definition at line 130 of file Weather.h.
Referenced by AWeather(), and UpdateRain().
|
private |
Definition at line 133 of file Weather.h.
Referenced by AWeather(), and CreateRainEmitter().
|
private |
Definition at line 141 of file Weather.h.
Referenced by EndPlay(), and UpdateRain().
|
private |
Definition at line 136 of file Weather.h.
Referenced by UpdateRain().
|
private |
Definition at line 160 of file Weather.h.
Referenced by ApplyWeather(), ApplyWeatherToSkyActor(), CheckWeatherPostProcessEffects(), ClearSkyLightMap(), PushWeatherToSky(), SetWeather(), UpdateRain(), and UpdateStreetLightsForDayNight().