Tidewater: Oceans, Lakes, Rivers, Waterfalls, Swimming and Splashes Water Kit
README.md
Cloudburst — rain, snow, storms and fog
Weather that reads as weather. Rain you can feel: soft, slightly see-through drops lit by your sky, sun and street lamps, streaking as they fall and as you move, thick around you and thinning into grey curtains in the distance. The world answers it: drops splash on the street and on the roofs, ring the pond and the puddles, drip from eaves and branches, and the ground darkens and shines as hard as it rains — while under a roof it stays bone dry. Snow tumbles and settles on what faces up, wind leans everything and gusts come and go, fog lies in the valley, and thunderstorms flash and rumble, with thunder arriving later the further away the strike. Every player sees the same weather, the same strike at the same moment, the same change from clear to storm and back — including someone who joins in the middle of it.
Make it rain in two minutes
-
Install Cloudburst from ZeroMind into your world.
-
Add the weather to your scene (in
build.luau, or once from the console):local w = entity.spawnSynced("Weather") w.component.add("Cloudburst", { preset = "light_spring_rain" }) -
Press play. That's rain.
Change one field to change the weather: preset = "night_storm_town". Any single setting works the same while a preset runs: set rainLook = "pixel" (or snowLook, lightning, splash, fogBank, kind, wind...) and the weather keeps everything else the preset had and changes just that, live, for every player. Or clear preset and pick
a kind (clear, cloudy, drizzle, rain, downpour, thunderstorm, snow, sleet, hail,
wind, fog, mist) with one intensity dial from 0 to 1. Changes fade in over changeSeconds.
A name the kit does not know is warned about once and falls back to clear.
From code, any player:
local Weather = require("cloudburst.weather")
Weather.preset("night_storm_town", 30) -- fade into a storm over 30 s
Weather.set({ kind = "snow", intensity = 0.8, snowLook = "fluffy" })
Weather.cycle({ { "clear_day", 3 }, { "steady_rain", 2 }, { "night_storm_town", 4 } })
What's in it
| Kinds | clear, cloudy (overcast), drizzle, rain, downpour, thunderstorm, snow, sleet, hail, wind (wind and gusts), fog, mist |
| Rain looks | realistic, cinematic heavy (glints round lamps), soft painterly, cartoon, pixel, ink / woodblock |
| Snow looks | soft realistic, big fluffy cartoon, fine powdery blizzard, pixel |
| Lightning | storm (forked + in-cloud), close forked strike, flash inside the clouds, distant silent heat lightning |
| Splashes | realistic crown, misty spray, cartoon, pixel, ink, none |
| Fog banks | valley fog, ground mist, sea fog, town haze — as the weather's own fog, and as the FogBank component to place a bank where you want it |
| Water | cb_pond and cb_puddle materials that ring where drops land; Weather.bind(material) |
| Presets (23) | clear_day, light_spring_rain, steady_rain, autumn_drizzle, tropical_downpour, night_storm_town, noir_rain, hailstorm, sleet_squall, alpine_snow, blizzard, misty_dawn, valley_fog, sea_fog, town_haze, gale, summer_heat_lightning, painted_showers, cartoon_rain, cartoon_snow, pixel_rain, pixel_snow, woodblock_rain |
Every preset is the same handful of settings, so swapping one for another is one change.
How it works (and why it is cheap)
- All falling weather lives on the GPU. Each layer is a static mesh of quads whose motion is in its shader; per drop there is no CPU work at all. A downpour costs the same CPU as a drizzle.
- The engine's own weather does the surfaces. Wetness, settled snow and dry ground under
cover come from
@builtin::systems.weather; fog from the engine's height fog; wind from the engine'sWind(so foliage and physics lean with the rain). Cloudburst does not keep a second copy. - The landing map (
cloudburst.landing) is the one piece the engine lacked: the height of the top surface a drop meets coming down, cast around the camera a few rows a frame. Drops stop on roofs (none indoors), splashes sit on what they hit, and drips are found at every eave. - Multiplayer: the weather is a few synced fields plus the shared session clock. Lightning comes from a seeded schedule on that clock. Nothing streams per frame.
- Flash safety: at most one lightning flash every 2.6 s, each a single soft pulse with capped
brightness.
Weather.setFlashComfort(0..1)lowers it further per player.
For other kits
Weather.now()— the weather this frame (rain, snow, wind, fog… 0-1, wetness, wind vector).- Named values, for kits that should not depend on Cloudburst: every frame the weather entity
holds
weather.rain,weather.snow,weather.wetness(0-1) andweather.wind(vector, m/s).values.get(id, "weather.rain")on any entityvalues.entities()lists reads it; a water kit rings its lakes and puddles from it (Tidewater does), with no require of Cloudburst. Weather.onStrike(fn)— every lightning strike, on every peer at once.Weather.landsAt(x, z),Weather.isSheltered({x,y,z}),Weather.landings(centre, r, dt)— where rain lands.#include "cloudburst.shaderModules.cb_common"andcb_ripples(...)in your water shader;Weather.bind(material)keeps itscb_raininput current.cb_pond/cb_puddleare ready-made.
Guides inside
- How to make it rain in my game — adding weather, picking a kind, changing it over time, presets, shelter, sound, multiplayer.
- Example: a village from dusk into a night storm — step by step from an empty world.
Works with
worldClockKit (day/night and lamps) — turn its own precipitation, lightning and sound off
and Cloudburst does the weather; storms dim whatever sun it sets. Cloudburst needs no clock kit.