raisin::WeatherSettings
struct · #include <rayrai/Weather.hpp>
Weather state applied on top of the renderer (RayraiWindow::setWeatherSettings()).
While enabled is true the window re-derives its effective RenderQualitySettings from the last settings passed to setRenderQualitySettings() every time weather changes: the main light (sun/moon direction and color), ambient, procedural sky and clouds, environment tints/intensity, exposure, cloud shadows and the wet/snow material fields are overwritten, while fog density, height fog and volumetric fog/lighting are combined with the user values (the larger density wins). Disabling weather restores the user settings.
Values are clamped by setWeatherSettings() (ranges noted per field). Several effects are driven by timeOfDayHours, so advance it to animate lightning, cloud drift, rain ripples and volumetric fog.
Public attributes
enabled
bool enabledApply weather to the viewer render.
preset
WeatherPreset presetPreset these values came from (Fog/Snow/Storm also tweak some derived values).
quality
WeatherQuality qualityEffect cost tier; see WeatherQuality.
seed
uint32_t seedSeed for precipitation particles and lightning strike placement.
timeOfDayHours
float timeOfDayHours[0, 24]. Local solar hours when the UTC offset is automatic; civil hours otherwise.
latitude
float latitudeDegrees, [-89.9, 89.9].
longitude
float longitudeDegrees, [-180, 180].
automaticUtcOffset
bool automaticUtcOffsetDerive the continuous solar offset as longitude / 15.
utcOffsetHours
float utcOffsetHoursExplicit local civil time minus UTC, including DST, [-12, 14].
year
int yearCalendar date used for the solar position, [1900, 2500].
month
int monthMonth, [1, 12].
day
int dayDay of month, [1, 31].
windDirection
glm::vec3 windDirectionWorld-space wind direction (normalized; XY drives cloud and fog drift).
windSpeed
float windSpeedMetres / second, >= 0. Slants precipitation (capped at 20) and drives volumetric fog drift.
transitionSeconds
float transitionSecondsSeconds, >= 0. Stored and interpolated only; the transition length used is the argument of RayraiWindow::transitionWeather().
affectSensors
bool affectSensorsAlso draw weather screen effects in RaiSim RGB/depth sensor renders.
cloudCoverage
float cloudCoverageFraction of sky covered, [0, 1].
cloudDensity
float cloudDensityCloud opacity, [0, 1].
precipitationRate
float precipitationRateNormalized rain/snow intensity, [0, 1] (presets use 0.45 to 1.0).
rainOcclusionStrength
float rainOcclusionStrengthShelter factor, [0, 1]: scales precipitation and wetness by (1 - value).
fogDensity
float fogDensityDistance-fog density, 1/m, [0, 1]; combined with the user fogDensity by max() and also raises the height-fog density.
visibilityMeters
float visibilityMetersMetres, >= 1. Below 5 km enables height fog with density about 3 / visibility.
fogColor
glm::vec3 fogColorLinear RGB color used for weather height/volumetric fog.
fogAnisotropy
float fogAnisotropyHenyey-Greenstein g for volumetric fog, [-0.85, 0.85].
humidity
float humidityNormalized [0, 1]; raises wetness from precipitation and slows drying.
wetness
float wetnessBase surface wetness, [0, 1].
wetnessAccumulationEnabled
bool wetnessAccumulationEnabledAccumulate and dry wetness over time in RayraiWindow::updateWeather().
wetnessAccumulationRate
float wetnessAccumulationRateFraction of the remaining gap to the wet target closed per second, [0, 4].
wetnessDryingRate
float wetnessDryingRateWetness lost per second when drying (scaled down by humidity), [0, 4].
snowCoverage
float snowCoverageSnow cover on surfaces and ground tint, [0, 1]; above 0.2 precipitation renders as snow.
lightningRate
float lightningRateLightning strikes per minute, [0, 16]; requires High or Ultra quality.
lightningLocalPointLightEnabled
bool lightningLocalPointLightEnabledAdd a transient point light near the camera target during a strike.
lightningLocalPointDistance
float lightningLocalPointDistanceDistance of that light from the camera target, metres, [2, 250].
lightningLocalPointRadius
float lightningLocalPointRadiusInfluence radius of that light, metres, [1, 500].
lightningLocalPointIntensity
float lightningLocalPointIntensityPeak intensity of that light, [0, 12].
thunderSpeedOfSound
float thunderSpeedOfSoundm/s, [250, 420]; thunder delay = lightningLocalPointDistance / speed.
airTurbidity
float airTurbidityAtmospheric haze, [1, 12]; higher values give hazier, warmer horizons and sun color.
groundAlbedo
float groundAlbedoGround reflectance used for the lower-hemisphere environment tint, [0, 1].
useExplicitSunAngles
bool useExplicitSunAnglesUse the two angles below instead of computing the sun from date, time and location.
sunAzimuthDegrees
float sunAzimuthDegreesDegrees, wrapped to [0, 360). The main light then travels along (cos az * cos el, sin az * cos el, -sin el), azimuth measured from world +X toward +Y.
sunElevationDegrees
float sunElevationDegreesDegrees above the horizon, [-8, 89].
sunDiskSize
float sunDiskSizeAngular radius of the drawn sun disk, radians, [0.001, 0.08].
moonDiskSize
float moonDiskSizeMoon disk size in the generated weather sky, [0.001, 0.08].
cloudAltitudeMeters
float cloudAltitudeMetersVolumetric cloud base, metres, [20, 12000]; used only when above 900 m.
cloudThicknessMeters
float cloudThicknessMetersVolumetric cloud layer thickness, metres, [1, 4000]; used only when above 250 m.
cloudShadowStrength
float cloudShadowStrengthCloud shadow darkening, [0, 1]; requires High or Ultra quality.
cloudScale
float cloudScaleCloud noise scale for the sky layer and cloud shadows, [0.01, 2].
cloudAnimationSpeed
float cloudAnimationSpeedCloud drift: offset = windDirection.xy * timeOfDayHours * speed, [0, 200].
lensDropletsEnabled
bool lensDropletsEnabledDraw rain droplets on the lens (rain only, High or Ultra quality).
lensDropletStrength
float lensDropletStrengthLens droplet amount, [0, 1].