Skip to content

Arktii/aseprite_rain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 

Repository files navigation

aseprite_rain

Overview

This Aseprite script procedurally, and non-destructively, animates rain.

Example 1

This is especially useful for scenes with very dense rain, as animating those by hand can be a lot of work.

Features

  • 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

How to Use

Download Rain.lua and drop it into the scripts folder
296418630-e0be082a-71df-4196-90ba-ac07684303d7

2. Run the script (Rain)

image

3. Customize the rain then click Run

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.

dialog box

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

4. Move layers around

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.

layers

Examples

Drizzle
Example 4

Rainstorm
Example 1

Monsoon
Example 3

Angled
Example 2

Customization

Frames

The number of frames the animation will span. More frames will take longer to generate but will ensure more variation in the rain.

Layers

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.

Presets

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

Raindrop Color

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.

Drop Length

The length of each raindrop in number of pixels

Anti-Aliasing

Whether or not to use Anti-Aliasing when drawing the drops.
Note This looks better on big canvases.

Speed

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.

Angle

The angle of which the raindrop is travelling, in degrees, measured with respect to the negative y-axis.

Spawn Rate

The number of drops spawned per frame (drops per frame).

Length Randomness

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.

Angle Randomness

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.

Algorithm Related Notes

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

About

an aseprite script for quickly creating rain

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages