Perlin Noise in Animation


My goal for this project was to develop a tool that allows an animator to add noise to animation primitives (joint angles, object translations, light intensities, etc) and then explore the possible uses for noise in animation. After struggling for a bit with the internal mechanics with Maya(tm), I managed to create a small, but effective plug-in. Once my plug-in was finished I set out to experiment and find good uses for the noise.

The Plug-in (source code)

The internal construction of Maya is built upon a data type called a "directed graph node". Every primitive in Maya is a directed graph node in some form or another, each with inputs and outputs that link together to create network that passes data from node to node. My plug-in is simply a node that can be inserted in between a regular connection to add noise to any floating point value. For example, I can connect the time slider output to a noise node, and then connect the output of the noise node to a X translation of a sphere. As time passes the X translation of the sphere will quiver as noise is added to it. This implementation is nice because it allows me to add noise to virtually any value in Maya.

When applying noise in animation it is essential that the process be interactive. Tuning and tweaking the noise parameters is necessary to attain the effect you want. With this in mind I created a simple GUI interface to control the noise attributes interactively. The noise generated is simply two-layer Perlin Noise, created by interpolating between and combining two sets of random points. Once the node is added you can interactively change the intensity and frequency of each noise layer while Maya plays the animation. For more varied type of noise I also included the option to add a cosine and stepwise signal to the noise. The cosine value is good for creating a more rhythmic noise signal (i.e. a person swaying back and forth) and the stepwise is good for creating noise that move to a certain value and maintains that value for a bit before moving to another (i.e a person gazing around a room). Both of these noise additions have controllable variable via the GUI. The plug-in also allows you to choose between 3 different interpolation types: linear, cosine, and cubic. Each has a distinct look, and can be used for different desired effects.

I wrote the GUI in MEL (Maya Embedded Language) and the script is sourced when the plug-in is loaded. The somewhat bland interface is pictured below.

figure 1.2.482

My plug-in is not completely bug-free, but if anyone wants to give it a whirl, here is the compiled, finished product noiseNode.mll, and heres the MEL script to create the GUI noiseNode.mel. To load a plug-in in Maya type loadPlugin "[drive]:/blah/blah/foo.mll". Once the plug-in is loaded the command noiseNode [float value] ["gui"/"nogui"] will create and insert the noise node.

My Examples

About a third of the time I spent on this project was dedicated to making some good examples of how noise can be used in animation. I ended up only coming up with a few decent ones, but I believe there are is an unlimited number of uses for this sort of thing. You just have to be able to think of one.

The Bubbles (bubbles.avi(~2MB))

For this example I wrote a small script to automatically generate the bubbles and add random amounts of noise to each one. I think this example exemplifies how noise can be uses in procedural animation techniques. Each bubble is perturbed by a different noise node and the end effect is a field of jiggling bubbles. This effect may not follow the rules of physics, but it looks decent, and since there are no complex equations to be computed, an animator can generate as many different bubble field as he/she wants in little time and pick the best one. Here is my bubbles MEL script: bubbles.mel.

Procedural Crowds

This is another example of noise used in a procedural method. Each person has noise added to different joints in their body, and each move different. Too much noise makes the crowd look like a bunch of fidgety idiots, but with the right level a subtle, lifelike movement can be achieved. It's actually pretty convincing from afar. Unfortunately a ~5 second animation does not do this sort of effect justice, so I choose not to do a finished rendering. I also made a cheering crowd (not pictured), and this also worked well, but I had to be much more precise about what kind of noise to use and where to use it. From far away it looked like a decent approximation of a cheering crowd. Here is the crowd script (I'm pretty sure it's broken right now): crowd.mel.

Divine Intervention (walk.avi(~2MB))

Of course if I'm using noise for character animation I should try some sort of high frequency, violent thrashing motion. What else could I do other than make an animation of a guy get hit by lighting? I key-framed the walk, but everything between the lightning striking and him falling down is generated completely by my noise functions. Even the lighting and the light levels are driven by noise. Of course this example only shows less than a second of noisy animation, but I think it exemplifies a few ideas well. Firstly, noise can create somewhat lifelike human motion, and secondly, noise is a quick easy way to generate environmental effects like lighting. The original animation for this example was much longer, showing the man being struck for approximately a minute and a half while convulsing on the ground. However, after considerable review I deemed it inappropriate for class. Perhaps I'll release a directors cut later.

Facial Animation

Using noise for facial motion actually worked really well. Not only could noise functions drive this characters drifting head and eye motion, they were also great for adding motion to facial features. By simply grouping several control vertices together, and adding translate and scale noise to them, the character seemed to come to life. It was particularly interesting to play with the noise frequencies on this model. When the frequencies were low it gave the impression that he was lazily gazing around, but at higher frequencies he emotes a more panicked look. Also, subtle movement like nostril flare and ear twitching actually helped give the model a much more lifelike look. I got the idea to try something like this from Ken Perlin himself. His version is here Perlin's Page .

Demonic Something-or-other (demon.avi(~3MB))

I'm not sure what motivated me to make this animation, and I'm even less sure what the hell is supposed to be happening in it. There are, however, several examples of noise usage sprinkled throughout the animation. Firstly I'll mention the elements that aren't completely evident. The intensity of the glow of the demons eyes, and the intensity and shape of the candles are driven by noise. The demons bobbing motion before jumping originally came from the application of a noise function to his pelvis joint. Finally, the lighting and limb motion are driven by noise. Here's a picture from the sequel to this animation: sequel.

Closing Words

I learned a lot while working on this project. Noise is both a wonderfully creative entity and a destructive force wrapped into one. In some places noise can create a perfect, desired effect, but in other places it can ruin animation. What makes noise useful unfortunately makes its range of use slightly restricted. In the right situation with the right amount of patience noise can work wonders. It's a quick, interactive method to create effects that would otherwise be nearly impossible to create by hand. It doesn't solve all the problems that make animation hard, but it is a very handy tool