Looping a Procedural Texture
March 2001

Most of you probably know this trick already, but someone asked me recently so here goes.

Here's a way to get a procedural texture to loop, for instance when someone needs to make a looping animated texture for a real-time 3d game, like water or smoke or something.

1) In 3ds Max, use a Mix map. Add a procedural texture to the first slot. Animate the phase from 0 to 1, frames 0 to 30. Name it fubar.

2) Copy it to the second Mix slot, name it wtf. Change its phase animation so it goes from -1 to 0.

3) Crossfade wtf overtop fubar, by animating the Mix Amount 100 - 0, frames 0 to 30. Example: Looped (478KB QT).

Loops ok at this point, but depending on your texture it may lose contrast in the middle during the crossfade.

4) Add an Output map type on top of the Mix. Animate it on frame 14 to add the contrast back (I used Output Amount = 1.3, RGB Offset = -.1), then animate the ouput back to the default on frame 30. It helps to turn off Show End Result to remove the shading, so you can see what you're doing.

5) Right click on the sample to render it out, frames 0 to 29 (skip f30 cuz its the same as f0). Example: Corrected constrast (466KB QT).

Loops better, but this trick really only works with grayscale textures, because Output (or any other Levels-type filter for that matter) tends to mess up colors, over-saturating them.

The phase-looping idea works with the Noise modifier too. I dunno how you'd fix the dipped contrast in the middle, but it hasn't been all that noticeable when I've done it.

I'd love to hear other ideas for looping procedurals... this is probably more convoluted than it needs to be.

Also, anyone have an idea for making an animated texture tile seamlessly? My current method is a bit unweildy.

ec1@ericchadwick.com
http://www.ericchadwick.com