Creating High Patch Count Surface for Displacement Mapping

How many patches are 'high' enough you ask? Well, how long is a piece of string? I'll start by saying that displacement mapping is one of the few things that you really need to take into account your target resolution. Displacement maps do inherently have artifacts associated with them, these artifacts will become more apparent at higher resolutions. The simple solution is to create a surface with a higher patch count and the artifacts will disappear, the downside is your render times will go through the roof. The only way to know when enough is enough is to render test surfaces at your target resolution and keep upping the patch resolution until you are satisfied with the results. A bit tedious I know, but what in animation isn't? Get used to it buddy :P

Making & Mapping the Surface

I experimented a bit with cylindrical projections at first but found it wasn't really worth the trouble. What we want here is a single undistorted map, the kind of mapping you only get from a single stamp from an orthographic view on a flat plane. Huh? I thought this was supposed to be a mushroom cloud? No you heard me right, on a flat plane. Don't worry about the shape, we'll fix that up later.

To make the plane it's as simple as going into the front view and making a spline with 'x' number of points then extruding it 'x' number of times. For my little 352x288 resolution i found a 42x42 patch grid to be just right, remember to run tests and increase this if you plan to render at higher resolutions. Just about any image'll do for your test. You'll find it a lot easier if you use grid snapping while making your patch grid, and even easier if you use one of the freeware plugins that are apparently out there for making grids (I didn't use one of these so you'll survive without them I'm sure).

Start with a spline in the front view Extrude to a plane Stop when you have a square plane


So what you need to do now is apply your decal onto the flat plane. It doesn't matter what that decal is as we'll swap in the displacement maps later on. It's fine to leave it as a color map for the time being, but it's important to map now because we're going to move a few points around which will make mapping near impossible later.

Any ol' decal will suffice

Turning your Plane into a Cylinder

Because of the way our constraint system works we will need to bone a cylinder, not a plane. You'll need to make a circle shape for reference that has the same number of points as your grid has patches along one axis (the same number you used for 'x' before). To make this shape make a vertical two point spline on you front view and 'snap to grid'. Go into options (ctrl-p windows users) and under the 'modeling' tab set the lathe cross sections to 'x' (in my case 42). Move the spline along the X-axis so it's not sitting on the y-origin. For some reason you can't lathe this spline if you draw a selection box around the two points, you need to select a single point and hit the '/' key to select the whole thing. In your properties panel set the X-value of the pivot position back to 0, then hit the lathe button. Select the bottom ring of points and hit delete so you're left with just a circle. Move the circle up out of the way (ie. along the Y-axis, so it's still sitting on X-0, Z-0).

Make a simple spline and set the pivot to x-0 Lathe it round Delete the bottom rung and you have a circle

What we're going to do now is use the circle as reference in the top view and move all the columns of points on the grid so they're sitting on the circles points. Since scale is relative you can scale the circle to any size that's comfortable, then select the grid and hit the lock button. In the top view draw selection box around each column of points and get moving!

Lay it out in the top view Move each grid column onto a circle point In no time you'll have a cylinder

What some of you might by thinking at this point is, "Hang on, we're just moving points around, the surface isn't going to be welded closed, and we're going to use displacement maps - isn't there going to be a big fat seam!?!". Well yes and no. Technically there is a seam there, but you wont be able to see it. The mesh should have enough points that the curvature difference is so slight at the seam that when the surface isn't displaced it won't pick up on the render. The cap of the mushroom cloud is smooth from when it punches through different layers in the atmosphere, so you can look at it at most angles including above without seeing any seam. Remember it's physically impossible to see more than about 180 degrees of an object's surface unless it's transparent or has a mirror behind it. You can just pull the "Ye Olde Hide The Seam At The Back Trick". If you really need to do a 360 fly around or similar you could either just mirror/tile the texture on the X-axis (with a mesh this dense I doubt the seam would be apparent), if that fails you could constrain the surface to rotate along the Y-axis so it always faces that camera and compensate for the move with textures. This all seems pretty dodgy I know, but if you can't see the flaw and it doesn't affect your animation in the slightest, does it really exist? Here's a couple of phrases to see you through your next animation:

"It 'ain't a crime if you don't get caught"

"If a tree falls in the woods and there's no one around to see it, is it worth modeling, texturing, lighting, and animating it?"

Feel better? I do.

Now on with the tutorial!

So at this point you should have a high-patch-count grid in the shape of a cylinder that has mapping. Right? Good. What we need next is bones, lots of bones for our constraint system. Go into the front view and into bones mode and start placing bones from the centre out to the edge of each row of points and then associate the row with that bone. Start from the top and work your way down until each row has it's own bone, making sure the bones are not parented.

From the centre to the edge One for each row of points It should end up like this

The Control Spline

The control spline is the profile shape that will control the the mesh. This is what we animate. It doesn't matter how many points the control spline has, that doesn't affect anything. As usual though you should only have as many points as you need to give you the shape you need without any unessential points (because you'll have to animate them). Create a new model and draw out your spline so that if lathed it would look like your mushroom cloud, it helps to lathe it occasionally as you go along to just check the shape. It's best if you build it so the Y-origin is the axis you lathe around, just makes it easy (so make sure the top point is on X-0, Z-0). Once you're happy with the shape create a new action for it.

Not much to say here

The Action

Time to create all the motion that makes the mushroom cloud mushroom-cloudy, this is probably the most important part of the whole procedure so don't rush it. Go into muscle mode and head to about frame 100 and set a keyframe on all the points. Then go back to frame 0 and straighten out the spline so all the points are below Y-0 (below the ground plane in other words) and set another keyframe. Not much to say next but keep pushing points around and adding keyframes in between until the motion looks right. Once again it doesn't matter if the points are unevenly spaced, what does matter though is that the spline stays roughly the same length at all times.

Set a keyframe at 100 Go back to 0 and flatten it out Add your in betweens

The Constraints

There are constraints, oh yes. Lots and lots of constraints...In fact we need to constrain the crap out of this mesh. Still in the action you've created, create a new null...for each bone. Actually you'll need to create two, but for now just create one for each bone and call them something like 'path (1)', 'path (2)'....'path (41)'. Now we need to put a path constraint on each of these nulls so they sit at a certain percentage along the path. You need to work out what percentage each null will need to sit at, the basic formula is 100/(number of bones -1). The '-1' is because one null will sit at 0%. In my case I had 41 bones, so 100/40 = 2.5. My first null is path constrained with the ease set at 0%, the next at 2.5%, then next at 5%, and so on. Make sure that enforce is at set 100% and that you only have a single keyframe for the ease channel at frame 0. After you've done this for each of the 'path' nulls, create another set of nulls for each bone and call them something like 'rise (1)', 'rise (2)', etc. For each of these nulls there are two constraints, a 'translate to' and a 'translate limits'. Start by adding the 'translate to' constraints to all the 'rise' nulls and constrain them to their corresponding path nulls, eg. 'rise (34)' is 'translate to' constrained to 'path (34)'. Once again making sure they only have one keyframe at frame 0, and enforce is at 100%. Next put a 'translate limits' onto each of the 'rise' nulls with the 'X' and 'Z' values set a 0, so each of the rise nulls will only move along the Y-axis. If you've made it this far you're doing pretty well :). Drag'n'drop your cylindrical grid mesh onto the action so you've got it as an action object. Each bone has two constraints a 'translate to' and an 'aim at'. 'Translate to' constrain the each bone to its corresponding 'rise' null, and then 'aim at' constrain it to its corresponding 'path' null with the 'scale to reach' option checked. Once you've done this you're finished! Well the modeling and animating part anyway. Drag the control spline into a new choreography and drag the action on top of that to check out your handy work.

Path Nulls constrained to the Control Spline, Rise Nulls constrained to the Path Nulls Bones 'translate to' constrained to the Rise Nulls, 'aim at' constrained to the Path Nulls Now you're done!

 

Download the Project file for Part 1

Part 2: Generating Animated Texture Maps ->

Home

 

Copyright © 2001 by Ilya Anisimoff. All rights reserved.