Animating Water Question [with displacement mod and key shapes]

Hello everyone, I’ve been playing with ways of animating water, primarily with lattices, displacement modifiers hooked to null objects, and shape keys. Eventually this needs to be exported to a game engine (that will recognize key shapes) and that leads me to my problem:

In a simple test, I’ve got a displacement modifier on the mesh, hooked to a null object creating some “flowing water” from left to right. The problem is, I haven’t been able to (nor am I sure) that key shapes can interpolate the horizontal movement (setting key shapes and mixing them only makes the water move on the Z axis, there is no horizontal movement at all). I’ve thought of just making X number of key shapes for the entire animation, but that would take forever and be a mess to mix (and using a lattice would not be any faster). Is there any quicker way of getting key shapes to recognize this type of movement?

Thanks for reading this.

I ran into a similar problem animating a ring-shaped ripple effect, and no, there is no simpler way to do this with shape keys. The lateral motion of your wave forms has to be incorporated into the shapes, and given the type of motion this produces, it can’t be interpolated successfully over a number of frames – you need lots of shape keys. However, you may be able to automate the generation of this key set. If your current setup does a good job, try exporting the mesh deformations as a .mdd file and then re-import that as a set of shape keys. AFAIK, the .mdd export looks only at vertex location data when exporting, so it incorporates all influences on the mesh – armature, cloth sim, soft body, etc. I’m not so sure about displacement but it’s worth a try. In the User Prefs>Add Ons>Import/Export section you’ll need to enable the Newtek MDD Format add on. This is used for both exporting the vertex data and importing it as a shape key series. With some work, you should be able to convert all your water animation influences into a discrete set of shape keys suitable for use as vertex animation (as the process was originally called in a game environment).

Excellent advice, thank you. The process does work with displacement modifiers, the only odd part is that it makes the mesh 5-7 times larger back in blender- is this a “known issue” or a quirk of the process? (though of course, this shouldn’t be an issue in the engine).

Check to see if your original mesh is at scale 1.0 when exported, and the same for the mesh to which the shape keys are applied. Also check the .mdd exporter settings and see if there’s something there that might affect the scale, though in my experience with cloth sim exports, there was no scale issue attributable to the export process. Maybe it has something to do with the displacement? This can affect the rendered scale of an object, maybe it’s an effect in the export process as well – just speculating.

I’d be interested in seeing your result as well, a good water methodology is very useful.

Tired a few different things, as you suspected it was a simple case of applying scale to the mesh - problem solved. As far as my result, it really is nothing groundbreaking (doubt it is anything you haven’t seen before). It is a concept water animation for a map view of the game (think something like Port Royale or Civilization) where the player is operating from a “god view”. It was a compromise to be “more realistic” than a traditional flat plane with a water shader, but much easier to produce than a custom script to deform the mesh vertices points using a few math formulas for waves.

Essentially, it is just 1 large plane divided into vertex groups which are hooked to different null objects moving in different directions, speeds, and with different intensity factors to simulate the variance in flow patterns in a large body of water.

I’ve thought about trying this with a blender fluid sim, but I think (given how long it can take to render a sim in order to check if it “looks right”, and its high poly count) that the scripting option would actually be faster…Although in your case, a “ripple” effect could work quite well for something that (or maybe even dynamic paint).