/Tutorials Web demo All tutorials ← Site

How to animate falling snow in pixel art

Falling snow is a loop of identical white pixels moving down a scene. Drawing that by hand is hours of work for something a rule describes in four lines.

Phluxel · Windows · a free edition covers everything on this page

What you need

The steps

Step 1

Paint the scene once

Draw your background, characters and props as a single still image — or import a PNG you already have. There are no layers to set up: the picture you paint is the simulation state, which is why the effect can react to it.

Step 2

Add the rule

Open the Rule Editor and create a new rule, or pick Falling Snow (behind objects, BASE) from the template list and skip the typing. This is the whole thing:

Falling Snow (behind objects, BASE)Phlux
PARAM _rate = 3;
Y == 0 ? (RN < _rate ? [255, 255, 255, 255] : [BASE]) :
(N.R > 245 & N.G > 245 & N.B > 245 ? [255, 255, 255, 255] :
(R > 245 & G > 245 & B > 245 ? [BASE]))

_rate controls how heavily it snows — the chance that each cell on the top row spawns a flake each step. 3 is a gentle fall; raise it for a blizzard.

Step 3

Turn Global on

Toggle the globe icon on the rule so it applies to every cell rather than only the cells you painted it onto. Effects that sweep across a scene are almost always global.

Step 4

Press play

The grid starts stepping immediately. Adjust the live parameters below the script while it runs — you do not need to stop and restart to see a change.

Step 5

Export the loop

File ▸ Export ▸ Animation. Set the frame count to the length of one cycle and Phluxel writes a seamlessly looping GIF. The same dialog exports MP4 and APNG, and there is a separate sprite sheet export if you are taking this into a game engine.

Why it goes behind your artwork

When a flake moves on, the cell it left is restored to its original colour from BASE. That is why snow can fall over a finished scene without slowly erasing it.

This is the part that usually surprises people coming from layer-based tools. There is no effect layer to composite. BASE is a token that always reads the original, untouched version of the cell, so a rule can paint over your scene one step and hand it back the next.

Do not paint pure white in the scene. A flake is defined as a cell where all three colour channels are above 245. If part of your artwork is pure white, the rule will read it as a snowflake and it will start falling. Nudge highlights down to around 240 and the problem disappears — visually it is identical.

Making it loop seamlessly

Set Max steps in the Playback panel to the number of frames you want, and the simulation returns to the start when it reaches that count. Export the same number of frames and the GIF has no visible seam. If the loop still jumps, the usual cause is a motion cycle that does not divide evenly into the frame count — a drop that needs 21 steps to cross a 20-frame loop will always stutter.

Tip. The timeline can ramp a parameter while the loop plays. Keyframe _rate from low to high and the weather builds over the animation instead of staying constant.

Try it without installing anything

Phluxel runs in the browser as a demo, and the free desktop edition has every feature with a watermark on exports.

Open the browser demo Download free (Windows) Wishlist on Steam

More Phluxel tutorials

How to animate rain over pixel artPaint it once, then one rule animates it. How to animate pixel art fire from a still drawingPaint it once, then one rule animates it. How to convert an image into pixel art with a locked paletteDownscale cleanly and snap the result to a Lospec palette.