#Your scene, your materials, their weather
NatureGL Weather adds its particle meshes to your scene and patches your MeshStandardMaterials. Nothing is swapped out. Call weather.update(dt) every frame. Then render with weather.render() for volumetric fog, puddle reflections and bloom, or keep your own renderer.render(scene, camera).
loadPreset('thunderstorm') on a running drizzle. Rain, wind, fog and the strike rate all ease to their new targets, and the demo sky follows the preset's time and cloud.- presets, one file each
- 7
- quality tiers, low to ultra
- 4
- rain streaks on ultra
- 90k
- per frame on high (Apple M5, 1280×720)
- 5.5–10 ms
#What's in the box
- Rain that reacts to light
Up to 90k wind-slanted, motion-blurred streaks with a bright head. Drops glow toward the sun and moon and around your street lamps. Splashes land on the ground and on roofs.
- Snow that settles
Swaying flakes that streak in strong wind and glint. Snow cover builds up over time on up-facing faces, roof slopes included, and shades cool blue.
- Lightning with thunder
Branching bolts and multi-pulse flashes that light the ground and the fog. Thunder arrives after
distance / 343seconds, andon('strike')andon('thunder')tell you when. - Volumetric height fog
Raymarched fog with shadowed light shafts, lamp halos and lightning in-scattering. On the plain render path it falls back to a matching
THREE.FogExp2. - Wet world
patchMaterial()adds wetness darkening, puddles with raindrop rings, snow cover and wind sway to any standard or physical material. - Dry under roofs
A top-down occlusion map that follows the camera. Rain and snow stop under roofs and trees, and the surfaces under them stay dry.
#Seven presets, ready to load
Every preset is a plain object in src/config/presets/. loadPreset eases to it, set changes any part of it, and getParams() prints the current weather as a new one.
downpourHeavy evening rain, full puddles, street lamps on.thunderstormNight storm, strong wind, frequent strikes.snowfallCalm snow over a settled blanket.foggyDawnLow ground fog, sun shafts, dewy ground.#Minutes to a rainy street
import * as THREE from 'three';
import { WeatherSystem } from 'naturegl-weather';
// renderer, scene, camera, sun and your meshes as usual
const weather = await WeatherSystem.create({ renderer, scene, camera, preset: 'downpour' });
// any MeshStandardMaterial can get wet; `ground: true` adds puddles and a full snow blanket
weather.patchMaterial(ground.material, { ground: true });
weather.patchMaterial(houses.material);
weather.setOccluders([ground, houses]); // no rain under the roofs
weather.setLighting({ sunDirection: sun.position.clone().normalize(), sunColor: sun.color, shadowLight: sun });
renderer.setAnimationLoop(() => {
weather.update(timer.getDelta());
weather.render(); // or renderer.render(scene, camera)
});#Surfaces keep a history
weather.set({ rain: 1, … }) on a dry afternoon. Wetness builds by about 0.08 per second at full rain. Puddles open once the ground is past 30 % wet, and raindrop rings ripple in them.Wetness and snow cover are state, not settings. Rain wets the ground, sun and wind dry it, snow piles up and rain melts it. Presets ease the surfaces to their own values over about 4.5 s, and then the natural accumulation takes over again. Read more in Wet surfaces and puddles.
#Part of the NatureGL series
NatureGL Weather takes its light from NatureGL Sky and draws its rain over NatureGL Water's ocean. NatureGL Island uses all three.