Loopable Chaos - Volumes!

In my previous tutorial, I discussed a method of using combinations of 3D textures to create a sequence of 2D images which could be looped, yet still appear to be ongoing chaotic change. However, that technique won't work if what you want to create is a 3D volume, resulting in a 3D movie you want to be able to loop. For example, a fire in a fireplace, with logs and all. If you try to employ my previous technique, you end up with a dancing volume that appears to have at least 2 distinct portions to it: some sliding up and some sliding down.

In order to emulate a fire in a fireplace, the texture needs to move up and only up. Any downward motion just wouldn't look right. However this leads to a serious problem - you can move a 3D fractal texture up all you like and you're not likely going to hit a space where the pattern starts over. You'll never make a loop.

Let's start with some basics: create a new scene, place the default distant light at 0,0,0 and point it straight up. Then, open the property panel for it, select "Volumetric Lighting" (remember, you need to also enable volumetric lights in the global Render options panel), and then click "Volumetric Light Options." To save a little time, load this preset. I then changed things a bit: set the Radius and Height to 1m, and Attenutation to 40%. There, that clears out some of the grunt work. On to the real meat.

Move your camera in reasonably close and render frame 0. Looks reasonably like a flame in a fireplace. Once again, if you should render out several frames, the texture won't move at all because we haven't animated it yet. Open the Volumetric Options panel for the light again and click "Edit Texture". You'll see three layers to this texture. The Gradient layer controls color output so we're not going to play with it at all. For the two Turbulence layers, apply an envelope to the Z channel and have frame 0 at 0m, and frame 120 at 10m. For me, this results in the right speed for flickering flames in a confined fireplace. If you render out frames 1 to 120 (don't start at frame 0), you'll get yourself a nice fire movie. Only, it won't loop nicely. Once again, there's no relationship in the texture between the first and last frames.

Here's where we'll get tricky: what we need to accomplish is a method of getting the texture to repeat itself. Since only the Ripples texture intrinsically loops, and we're not using that texture, we need to fake it out. Add a null object to the scene, name it Fader, and place it at 0,0,0. Then at frame 120, place it at x=1km. Now go back to the volumetric texture panel and add a new gradient texture to the top of the list. Give it an Alpha mapping mode, an Input Parameter of "Distance to Object", the ref object of "Fader" and give it two keys: 0m all white, 100% alpha, and at 1km, all black, 100% alpha. If you render out the sequence again, you'll see the flame slowly fading away.

Now, clone the light once. On the clone, edit the volumetric texture and invert the keys on the alpha gradient. If you render out the sequence again, you'll notice it looks exactly like the first render you did. In this case, the first light is slowly fading out, while the second light is slowly fading in. The two combined result in the original 100%. But it still doesn't loop.

What we need to do is make it so the end of the animation of the second light matches the beginning of the animation of the first light. Once again, open the volumetric texture panel for the second light, and change the Z location keys of the two Turbulence layers such that they move from -10m at frame zero up to 0m at frame 120. If you render frame 0 and frame 120, you'll see they're identical. Now render out the sequence (remember, frames 1 to 120 - don't include frame 0). If you loop it, you'll get something like this.

Note that this technique is also useful for creating loopable 2D image sequences: Since we're making a volumetric texture that repeats in a series of frames, you can take any 2D slice of that texture and get a repeating sequence of images.

(I've discovered a Lightwave bug: it won't save the scene properly, and reloading it won't render stuff out correctly. It loses the reference object for the two Distance to Object gradients. Load the saved scene file in a text editor and search for "Distance to Object". The following line will be 'ItemName ""'. Insert the word Fader in the pair of double quotes - do it for both instances! The scene will now load correctly, and oddly, save correctly too.)

An easier way to make Trekkish ship hull "Aztec" patterns

I'm always on the hunt for cheaper and easier ways to do things. If you're a Trek nut, you've probably given the special effects of the various movies a good hard look and noticed some exquisite texturing of the ship's hull. A fine example of a fan's work can be seen here. The thing to note is the repeating pattern of light and dark areas on the primary hull. Man, what a lot of work.

I found this site which had a pretty good tutorial on how to achieve the effect with fairly low effort. Low effort? Yah, right. It still was more than I wanted to invest. For starters, I haven't got enough experience with Illustrator to get the lines all lined up, and curved, and properly radial. Blek. I decided to come up with a trick that exploited the power of Lightwave (well, any 3D rendering app should be able to achieve the same results) and avoid even more work.

  • Lightwave can make cones.
  • Lightwave can project bitmaps onto surfaces using "cylindrical" mapping.
  • Lightwave can render orthographic projections.

Are you thinking what I'm thinking? I can make a pattern in just a few minutes. As in, perhaps five whole minutes.

Start up your favorite paint program (that can paint individual pixels) and make a very small bitmap. Black and white, 7 pixels across and 6 pixels down. I used Windows Paint. Paint a pattern of black and white pixels that has no intrinsic pattern to it and has a roughly 50-50 distribution of black and white. Something like this (It's zoomed in for clarity - those are really just single pixels):

Now, make a new bitmap that's twice as tall and four times as wide. Copy your base image into the upper-left corner. Then paste your base image again into the lower left corner. In the lower left, invert the black and the white (Windows Paint has no automatic feature to do this):

Now, Copy those pixels and drop them adjacent, and flip them left/right (Windows Paint does provide a method to do this automatically):

Now copy the pattern from the lower left to the upper right, and vice-versa:

We're now ready to exploit Lightwave. Save this image. Start up modeller and create a cone, on the Y axis, 500mm radius for all dimensions. Initially, give it a low number of sides, but we'll change that later. For the default texture, make an image map, cylindrical mapping on the Y axis, and use the little bitmap we've prepped. Turn off pixel blending and mipmapping. Click Auto Size. For the scale, set Y to 1/N, where N is how many concentric "stripes" you want (X and Z scale should already be set automatically). Set the Width Wrap Amount to how many radial repetitions you want. Save the object and start up Layout.

Load the cone into a new default scene. Change the default light to point straight down, and move the camera so it also points straight down, and then aim it over the cone. You may need to increase the light's intensity to get black and white results, as opposed to black and grey. Set your camera resolution to something square. If you're using Lightwave 9, set the camera type to Orthographic, and set the image height to 1m. If you're using an older version, set your camera very high up, and then zoom in so the cone occupies the whole image view. Render!

You may notice that yours doesn't quite look "round." This is because the cone isn't quite round. Go back to modeller and recreate it, only this time give it 1000 sides. That will make the base of the cone round enough that you won't end up with a pointy edge and an angular feel throughout the pattern.

I don't know about you, but I say that's a whole lot easier than playing for an hour in Illustrator. Of course, you might want a bit more control over exactly where things fall, and you may want a different pattern closer in to the center. This will take a bit more work, but you can easily figure that out on your own (slice the cone and define more surfaces).