Skip to content

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 ​

cpp
bool enabled

Apply weather to the viewer render.

preset ​

cpp
WeatherPreset preset

Preset these values came from (Fog/Snow/Storm also tweak some derived values).

quality ​

cpp
WeatherQuality quality

Effect cost tier; see WeatherQuality.

seed ​

cpp
uint32_t seed

Seed for precipitation particles and lightning strike placement.

timeOfDayHours ​

cpp
float timeOfDayHours

[0, 24]. Local solar hours when the UTC offset is automatic; civil hours otherwise.

latitude ​

cpp
float latitude

Degrees, [-89.9, 89.9].

longitude ​

cpp
float longitude

Degrees, [-180, 180].

automaticUtcOffset ​

cpp
bool automaticUtcOffset

Derive the continuous solar offset as longitude / 15.

utcOffsetHours ​

cpp
float utcOffsetHours

Explicit local civil time minus UTC, including DST, [-12, 14].

year ​

cpp
int year

Calendar date used for the solar position, [1900, 2500].

month ​

cpp
int month

Month, [1, 12].

day ​

cpp
int day

Day of month, [1, 31].

windDirection ​

cpp
glm::vec3 windDirection

World-space wind direction (normalized; XY drives cloud and fog drift).

windSpeed ​

cpp
float windSpeed

Metres / second, >= 0. Slants precipitation (capped at 20) and drives volumetric fog drift.

transitionSeconds ​

cpp
float transitionSeconds

Seconds, >= 0. Stored and interpolated only; the transition length used is the argument of RayraiWindow::transitionWeather().

affectSensors ​

cpp
bool affectSensors

Also draw weather screen effects in RaiSim RGB/depth sensor renders.

cloudCoverage ​

cpp
float cloudCoverage

Fraction of sky covered, [0, 1].

cloudDensity ​

cpp
float cloudDensity

Cloud opacity, [0, 1].

precipitationRate ​

cpp
float precipitationRate

Normalized rain/snow intensity, [0, 1] (presets use 0.45 to 1.0).

rainOcclusionStrength ​

cpp
float rainOcclusionStrength

Shelter factor, [0, 1]: scales precipitation and wetness by (1 - value).

fogDensity ​

cpp
float fogDensity

Distance-fog density, 1/m, [0, 1]; combined with the user fogDensity by max() and also raises the height-fog density.

visibilityMeters ​

cpp
float visibilityMeters

Metres, >= 1. Below 5 km enables height fog with density about 3 / visibility.

fogColor ​

cpp
glm::vec3 fogColor

Linear RGB color used for weather height/volumetric fog.

fogAnisotropy ​

cpp
float fogAnisotropy

Henyey-Greenstein g for volumetric fog, [-0.85, 0.85].

humidity ​

cpp
float humidity

Normalized [0, 1]; raises wetness from precipitation and slows drying.

wetness ​

cpp
float wetness

Base surface wetness, [0, 1].

wetnessAccumulationEnabled ​

cpp
bool wetnessAccumulationEnabled

Accumulate and dry wetness over time in RayraiWindow::updateWeather().

wetnessAccumulationRate ​

cpp
float wetnessAccumulationRate

Fraction of the remaining gap to the wet target closed per second, [0, 4].

wetnessDryingRate ​

cpp
float wetnessDryingRate

Wetness lost per second when drying (scaled down by humidity), [0, 4].

snowCoverage ​

cpp
float snowCoverage

Snow cover on surfaces and ground tint, [0, 1]; above 0.2 precipitation renders as snow.

lightningRate ​

cpp
float lightningRate

Lightning strikes per minute, [0, 16]; requires High or Ultra quality.

lightningLocalPointLightEnabled ​

cpp
bool lightningLocalPointLightEnabled

Add a transient point light near the camera target during a strike.

lightningLocalPointDistance ​

cpp
float lightningLocalPointDistance

Distance of that light from the camera target, metres, [2, 250].

lightningLocalPointRadius ​

cpp
float lightningLocalPointRadius

Influence radius of that light, metres, [1, 500].

lightningLocalPointIntensity ​

cpp
float lightningLocalPointIntensity

Peak intensity of that light, [0, 12].

thunderSpeedOfSound ​

cpp
float thunderSpeedOfSound

m/s, [250, 420]; thunder delay = lightningLocalPointDistance / speed.

airTurbidity ​

cpp
float airTurbidity

Atmospheric haze, [1, 12]; higher values give hazier, warmer horizons and sun color.

groundAlbedo ​

cpp
float groundAlbedo

Ground reflectance used for the lower-hemisphere environment tint, [0, 1].

useExplicitSunAngles ​

cpp
bool useExplicitSunAngles

Use the two angles below instead of computing the sun from date, time and location.

sunAzimuthDegrees ​

cpp
float sunAzimuthDegrees

Degrees, 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 ​

cpp
float sunElevationDegrees

Degrees above the horizon, [-8, 89].

sunDiskSize ​

cpp
float sunDiskSize

Angular radius of the drawn sun disk, radians, [0.001, 0.08].

moonDiskSize ​

cpp
float moonDiskSize

Moon disk size in the generated weather sky, [0.001, 0.08].

cloudAltitudeMeters ​

cpp
float cloudAltitudeMeters

Volumetric cloud base, metres, [20, 12000]; used only when above 900 m.

cloudThicknessMeters ​

cpp
float cloudThicknessMeters

Volumetric cloud layer thickness, metres, [1, 4000]; used only when above 250 m.

cloudShadowStrength ​

cpp
float cloudShadowStrength

Cloud shadow darkening, [0, 1]; requires High or Ultra quality.

cloudScale ​

cpp
float cloudScale

Cloud noise scale for the sky layer and cloud shadows, [0.01, 2].

cloudAnimationSpeed ​

cpp
float cloudAnimationSpeed

Cloud drift: offset = windDirection.xy * timeOfDayHours * speed, [0, 200].

lensDropletsEnabled ​

cpp
bool lensDropletsEnabled

Draw rain droplets on the lens (rain only, High or Ultra quality).

lensDropletStrength ​

cpp
float lensDropletStrength

Lens droplet amount, [0, 1].

RaiSim — physics for robotics and AI.