Skip to content

five-on-it / apps/client/src/renderer/weather-view

apps/client/src/renderer/weather-view ​

The room's weather and hour as the game draws them (GAME_DESIGN §5.7), every frame from the room clock and its weather (@foi/shared's weatherAt, worked out on the client as on the server):

  • The light (daylight.ts): the sky light and the sun by the hour, dimmed by clouds, the night no darker than the player's nightBrightness; the void's colour with it.
  • Fog (Babylon's EXP2 scene fog, always on, at no density on a clear day): thicker with the fog and a little with the rain. The minimap is drawn apart and stays clear.
  • Rain and snow: streaks and flakes as thin instances of one mesh each, in a box that follows the camera's target and stays put in the world as it moves (a drop wraps round the box, never drags with it), slanted and carried by the wind; fewer without a GPU.
  • What it leaves: wet roads (asphalt-grey surfaces: streets, kerbs, roofs) darken and catch the light, loose ground turns to darker mud, snow whitens the ground (loose ground the most), all on the level's shared materials, so it costs nothing per piece.
  • Storms: lightning flashes the sky now and then, its thunder (onThunder) heard a moment later.

Nothing here touches the simulation: the grip on a wet road is the simulation's own.

Interfaces ​

Variables ​

Functions ​