This Aseprite script procedurally, and non-destructively, animates rain.
This is especially useful for scenes with very dense rain, as animating those by hand can be a lot of work.
- Easily generate dense rain effects
- Create angled rain
- Customize raindrop appearance like color, drop length, speed, density
- Layered effects - create multiple layers of rain
- Non-destructive - animate rain on new layers
1. Install
Download Rain.lua and drop it into the scripts folder
See the section Customization below for a more detailed explanation on how each option affects the rain generated
Recommendation Take time to choose a color that matches the scene. Reduce opacity if needed.
The presets already provide flexible settings for almost any scene, but they don't modify the color at all.
Note this may take a few seconds based on the options selected and the canvas size
Note If you don't like the results, simply delete the generated layers and press Run again. There's a lot of randomness involved, so results will vary each time the script is run
The layers are generated on top of all other layers, but they can be moved around to form a foreground-background effect.
Note Each layer is drawn with a different opacity, so keep this in mind when choosing which layers go where.
If you want all your layers to have the same opacity, then set the Layers option to 1 then Run the script for each layer.
The number of frames the animation will span. More frames will take longer to generate but will ensure more variation in the rain.
The number of layers to be generated. Each layer is assigned a different opacity, this decreases with each layer, so the raindrops on layer Rain 1 will be more visible than those on Rain 4.
If you don't want this effect, simply set Layers to 1, then Run the script for each layer.
Pre-picked groups of settings that modify everything except color.
Note The presets were designed for a 128 x 96 canvas then scaled to the actual canvas size, so some values may get scaled too large in the case of very big canvases, this can cause long generation times if the settings aren't checked
This is the color of all raindrops on the first layer (Rain 1).
Note that opacity will be lower for the other layers, but aside from that, the color is retained.
Recommendation This is unlikely to look good right out of the box. Choose a color that matches the scene and reduce the opacity.
A custom color is likely to look better than just using white with a low opacity.
The length of each raindrop in number of pixels
Whether or not to use Anti-Aliasing when drawing the drops.
Note This looks better on big canvases.
The speed of a raindrop in pixels per frame.
Recommendation Choose a fairly fast speed. The algorithm does not have anything to ensure a seamless loop, but this is not very obvious when the raindrops are travelling quickly.
The angle of which the raindrop is travelling, in degrees, measured with respect to the negative y-axis.
The number of drops spawned per frame (drops per frame).
The left input field is for maximum shrink (only negative)
The right input field is for the maximum extension (only positive).
Each drop is shrunk or extended by a random amount within the range specified.
The left input field is for the maximum left rotation (only negative)
The right input field is for the maximum right rotation (only positive).
Both are measured in degrees.
The drop's angle will start with the angle specified in the Angle option, then it will be rotated by a random amount within the range specified.
Uses Xiaolin Wu's line algorithm to draw the raindrops with anti-aliasing https://en.wikipedia.org/wiki/Xiaolin_Wu%27s_line_algorithm
Uses Bresenham's line algorithm to draw the raindrops without anti-aliasing https://en.wikipedia.org/wiki/Bresenham%27s_line_algorithm