Rainy day
Experiment
today we expanded a rain simulation project using p5.js by adding a lightning effect confined within a silhouette of hills, creating an atmospheric and visually engaging scene of rain and occasional lightning amidst a landscape.
About the sketch
A thousand raindrops fall through the window. Each drop has its own thickness and transparency, and the thickness decides where it lands: thicker drops hit the ground a little lower, thinner ones a little higher, so that together they draw the outline of a hill. Where a drop lands it makes a splash whose size follows its thickness, and a new drop starts at the top. Every few seconds, at random, a flash of lightning briefly lights the whole picture.
It is a small study in how a simple set of rules can create the impression of weather and landscape without drawing either of them. The sketch is written in p5.js and runs live in your browser; it is a continuation of an earlier rain simulation with the lightning added.
Related experiments: Visualising Digital Dune Winds and the Moon experiment. More in the archive.