I started out trying to make a particle system to render snow falling. And I actually had pretty good results (what ended up as my GrooveFlakes sketch). But in the process I wanted to add a bit of “randomness” to the snowflakes, so I started investigating Perlin noise.
In this sketch, when you click on the applet, you can see the background cycle through the different noise maps:
- The first background (in color), is the combined map, which is the ‘x-map’ in the red channel, the ‘y-map’ in the green channel, and the ‘z-map’ (speed) in the blue channel.
- The second background is the “x-map”: Lighter values move particle the the right, darker values move particle to the left.
- The third background is the “y-map”: Lighter values move the particles up, and darker values move the particles down.
- The fourth background is the ‘speed map’ Lighter values speed the particles up, darker values slow the particues down.
- The fifth background is… no background at all.
- And finally, it loops back to the first background.
When the sketch starts, it generates the x, y, & z maps (each based on random Perlin noise) and saves them to an off-screen buffer. Then as the sketch runs, the particle queries its position on each map, and modifies its position based on the above rules.
PerlinParticle02 running with the combined RGB image in the background.
PerlinParticle02 running with no image in the background.