Lesson 5: Bells and Whistles Special FX

Lesson 5: Bells and Whistles – Special FX

Imagine a scene: You’ve modeled a gung-ho space pirate. Hes swinging into the finale of your animation, guns at the ready. Soon, he’ll bust through that plate glass window, lasers a flying, explosions a bursting… Wait. Breaking windows? Lasers? Fire? Someones gotta make all that stuff!

Effects are some of the most fun, and also most unique work you can do as a CG artist. Games and animations are chock full of particles and effects tricks to really make the scenery pop. From unassuming cozy fires to ghost-snatching colored beams, each effect is a unique challenge that must be addressed in its own way. This lesson we are going to cover some of the common ways you can produce snazzy effects right in Maya, as well as common tricks for real time effects.

Texturing Tricks: Quads are your canvas

The easiest way to get an effect harkens back to traditional animation, and is refreshingly simple: Just put it on as a texture. Combined with an alpha channel, this allows you to place any shape or visual effect right where you want it. This very simple concept can be used to produce dozens of remarkable things, both for use in Maya and in any realtime engine that supports transparency.

In order to do this, you need a piece of geometry. Often a single quad is used, because the lower the poly count, the faster it will render. Then you produce a texture with an alpha channel. One thing to note: When making the alpha channel, you want the color behind it to be as similar as possible to your background. This will prevent a white or black halo from appearing around your cutout Here is a grass texture I made for a tuft of grass.

Figure 5.001 – Grass Tuft [Caption: A simple tuft of prairie grass, with an alpha channel.]

We will create a new lambert, and assign our texture to it. By linking the alpha channel to the transparency channel, we create a cut out “card” with grass on it. I can then duplicate this card throughout my scene to create a whole field of grass.

Figure 5.002 –Field Comparison [Caption: On the left, a very boring background. On the right, after being populated with many tufts of grass.]

This kind of effect is great for games, since it is low poly. In pre-rendered shots, this can be used to produce fast rendering background elements. Since objects that are far away appear flatter anyways, no one will notice the grass is just flat tufts (until they are close up, at least), and since they are arranged in actual 3D, there is no need to mask out objects or characters that may move through them.

To build on this, we can also assign textures to other more complicated objects and combine these to make one effect. In this way we can hide that we are using simple objects, while still keeping our workload low. Say we were working on a game or movie where a wizard had to perform some magical effect. This kinda thing has to look snazzy!

Figure 5.003 –Wizard Hat [Caption: Tim the Wizard, looking a little drab.]

To start, I’m going to place a quad on the ground. This will be used for a circle swirling magic symbols and whatnot on the ground. Then Ill put three spheres on top of that, as shown. Each of these spheres will carry effects that will occupy the air above the circle. Then, for the sake of some extra bells and whistles, we will put 5 pairs of quads at 5 points around the circle, since pentagrams are often associated with wizards and magic.

Figure 5.004 –Primitve Placements [Caption: Some basic geometry laid out for texture placements.]

Now I make some textures. For the bottom, I make a circle of runic looking things. These are really just random marks and some squiggly lines to make them look more mysterious. For the spheres, I make some similar floating lines. Ill put these on the two overlapping spheres. Lastly, for my little set of 5 quads, Ill make a swirly spark. Don’t forget, each of these textures needs an alpha. In fact, each of these textures is just an alpha on a red square. Below are the alphas.

Figure 5.005 – Texture Alphas [Caption: When applied, the alphas over a plain background just cut out shapes the same color as the background.]

And applied to my objects. Notice how you cant really tell that I’ve got a bunch of quads in there, and my spheres are mostly invisible.

Figure 5.006 – Texture Alphas [Caption: The quads disappear, but the effect looks a bit dull still.]


Now I want to adjust the texture qualities a bit. Notice how the effect gets rather dark and so forth as they slope away from him. This is because they are just textured on. If these things are hovering magical effects, I want them to look that way, not dull and drab!
First thing I’m going to do is turn up the Ambience of the texture. This will flatten out the shading, which is part of what I want, and brighten up the object as a whole, which seems pretty good to me as well. Now lets take a look at a new attribute: Glow. Under the special effects tab of the material, there is a Glow checkbox and intensity slider. Glow is a post effect (meaning its applied after the rest of the scene has rendered) that puts a halo of similar color next to bright objects. If I set this to .5, and do a render, we can see our effect looks much more cheerful.

Figure 5.007– Glow [Caption: Now the effect is much brighter and looks self illuminated.]

Wizard Tim is looking pretty good. But it would be a bit odd if these magic runes just sat there. If I was going to do a still effect, I could have just painted it on. The nice thing about having all these textures on Maya objects is that we can do anything we want to them that we can do to a normal object.

So lets animate these quads a bit. Ill take the bottom one, and rotate it clockwise. The two spheres with lines on them I’m going to rotate in opposite directions from each other, but on different axis, so that they create a sort of swirling overlap as they move. Lastly, Ill take each of the 5 pairs of quads, and rotate each quad in opposite directions.

Movie 5.001 Basic Tim [Caption: Heres a little video after animations have been performed.]

Now Wizard Tim is really kickin! We could even get fancier, animating scale to simulate a growth, and opacity to bring the appearance of the effect in and out of existence, and smoothing the spheres a bit to prevent edges from appearing.

Movie 5.002 Super Tim [Caption: Heres a little video after animations have been performed.]

Animated Textures: For the Movie buffs in your Movies

A texture combined with an animated object is already a powerful tool, but it can be limited. Sometimes, you want the texture to move, but not the object. Luckily, Maya supports the use of movies and image sequences as textures. Animated textures are perfect for TV screens, calm water, and even odd things like pulsing lasers.

Figure 5.008 – TV [Caption: Look Ma! Wizard Tim is on TV!]

Lets start with the most basic example: A TV/Projection screen. Animated textures can come from any material. For simplicities sake, start with a lambert. Now, all you have to do is open up the attribute editor and click on the box next to color. Rather than select “File”, you can select “Movie” This brings up a new node that looks a lot like a file texture node. Select “Use Image Sequence” This tells Maya to look for a series of images. It decides what a series is by looking for numbers either before or after the file extension. “Mymovie_0001.tga” for instance, or “Mymovie_1.tga.” Now click the folder next to Image Name, and pick the first frame of your image sequence. No need to click any others. Once you confirm, Maya will make an expression which rotates through the frames of your movie for every frame of your Maya scene. An expression is a piece of Mel script that controls an attribute. Attributes controlled by expressions are tinted purple.

Figure 5.009 – Expression Driven [Caption: Here we are on frame 32, so image #32 in our sequence is being used as the display. Compare this image with frame 32 of the Wizard Tim Movie.]

Movies wont show up in real time, but if you do a render of your scene (to .avi or image sequence) you can see the effect of your texture. If you want the movie to look more backlit, you can turn on glow, and/or push up the ambience and incandescence

Figure 5.010– Glowing TV [Caption: Now your animated children can bathe in the glow of their animated television set.]

Using these movies does beg the question: where do we get our movies from? One source is actual footage: Movies, other animations you’ve done, TV, etc. You can adjust the footage in an editing package, such as Adobe After FX, or Final Cut Pro to suit your needs. These packages can also be used to produce footage, such as this fake caustic effect from after FX. You can also produce small frame animations by creating a series of images in photoshop.
Often, however, I use Maya to produce some footage, and then use that footage again as an animated texture. I will use particles, which we will discuss below, or animated geometry to produce an effect. Once rendered out, the texture can be applied to many other objects, to produce a simple and quick rendering effect that looks more complicated.

This brings us to a common device in games or other real time animations. By combining fairly simple animated textures and a few quads, we can produce firey trails or lasers. Lets take a closer look.

In essence, a laser is a beam that travels from point A to point B. In games, point A is often your character/ship/gun/bionically enhanced super dog, or whatever. Point B is where the super dog is aiming his super laser. Game programmers often use Point A and Point B to create a series of Polygons that stretch between the two points. These polygons are arranged in a Plus, triangle, or star shaped pattern, like so:


Figure 5.011– Star Quad [Caption: An arrangement of quads has an face perpendicular to the camera more often than just a single quad.]

The polygons look rather funny right now. But you’ll notice that regardless of what angle you view the column from, at least one quad is facing more or less directly at the camera The top and bottom edges are normally hidden or small to reduce the chances of seeing them for what they are. We can use a texture with transparent edges to create the effect of a cylindrical piece of geometry here.


Figure 5.012– Simple Laser [Caption: Notice the middle of the lasers appear round.]

Here is a file with a distorting NURBs cylinder. Its width changes, making the alpha channel of the resulting frames bulge. I don’t care about the color information at the moment. I took this Cylinder, rendered out a 6 frame cycle of it, and then took the frames into After Effects and blurred the alpha quite a bit. Photoshop could be used as well, on each frame. This creates a hazy halo, like so:


Figure 5.013– Pulse Laser Frame [Caption: A frame of the laser texture. On the left, the color channel, on the right, the animated alpha channel. Click to download sequence.]

Now, we want this fuzzy outline to crop out a blue laser. So I grab the blue gradient from before, and fill the images with it, but leave the alpha the same. This will ensure any semi-transparent pixels are still red. Next, we apply this texture as a movie to our quads. This creates a movie that plays until it ends (six frames total). We want our movie to loop. We can do this by animating the frame number instead of letting the expression drive it. At frame 1, we key the image number to 1. Then at frame 5, we key it to be 5, and at 6, we return it to 1. Opening up the graph editor, we set our tangents to linear. This turns ensures each frame falls on an even number. To repeat this infinitely, we select Curves > Post Infinity > Cycle with offset.

Figure 5.014– Cycling Graph [Caption: Enabling a curve to cycle infinitely is a good way to use it to drive repeatable or increasing values visually.]

This zig-zaggy curve will repeat the offset every 6 frames. You may need to show infinity by right clicking on the graph editor and choosing it from the menu. Now we have a pulsing laser beam that looks round.

Movie 5.003 Pulse Laser [Caption: Now we just need a spaceship and a dozen more of these!]

There are a lot of advantages to doing things this way: Quads are easy to generate dynamically for a program. Quads have only 2 poly’s in them, so a set of 3 quads would only be 6 poly’s, meaning many of these lasers could be visible on screen real time. By using a set of intersecting quads, we ensure the edges of our beam are transparent, while the center is opaque. If we had used a cylinder, reverse would have been true, which looks odd.
The same technique can be used above torches, to produce flickering flame, behind rockets (with a few random frames of blue/white trails) and so forth.

Particles: Not sub-atomic, but there sure are a lot of em:

So far, we’ve been using nothing but neat tricks using tools that we’ve already learned. Lets branch out a bit to cover some entirely new ground. You may have noticed it lurking there when you swap menu sets, its name alluring, yet cryptic: Dynamics.

The Dynamics menu sets contains a bunch of rather technical but immensely fun tools. Lets do a brief rundown:

Particles: Particles are dynamically generated objects that are very simply represented. They can be still 1 dimensional points, or more commonly, given a number of movement and appearance attributes. Due to their simplicity, particles are often used in very large numbers (thousands) to produce complex effects as a whole. Swirling smoke, Simple fires, fairy dust, super novas, and more can all be made with particles.