Not sure if any of you remember my old wave script (www.oregonstate.edu/~Dennisa/Blender/water.zip). It’s pretty outdated now, especially since there are better methods of creating wave motion than that python script. What my script did was use a hybrid fractal noise generator and used the values to create a heightmap of ‘waves’. But now that these sorts of noise functions are built into Blender’s procedural textures and we have true displacement functionality, this exact behavior can be duplicated without the hassle of a script.
- Create a plane which will be your ocean. For this example, I resized it so it’s 20x20 units.
- Under the Edit Buttons (F9) enable “SubSurf” and change the subsurface mode to Simple (In the drop down box)
- Underneith those buttons, there are two adjustable numbers. Change the one on the right side (That recalculates the subdivision during render time) to 6. Don’t forget to hit the tan ‘Set Smooth’ button.
*This sets the resolution of the waves. 6 is the maximum for render-time subdivision. If you want more resolution, simply go into edit mode and subdivide further.
- Under the Material Buttons(F5) add a new material, and then add a new texture(F6)
- Set the texture type to be ‘Clouds’
- For water, I’d set the Noise Basis to ‘Voronoi F1’, the Noise Size to 0.450 (or however large you want your waves) and the Noise Depth to 1.
- Go back to the Material Buttons, and under the ‘Map To’ tab, unselect Col, and select Disp. Slide the Disp slider to it’s maximum.
8 ) Add a lamp and do a test render. Adjust any of the size settings if needed. At this point the waves won’t move.
*If the waves aren’t high enough, assign the same texture to your material on the second channel. You’ll have to set the same MapTo settings for this instance also.
Additional Steps to animate the water
- Add an empty, go to the Edit Buttons (F9) and name it “Water”. It doesn’t matter where you put it for now.
- Resize it so it’s as big as your ocean (20x20 units in my case).
- Now select the ocean plane again, and go to the Material Buttons (F5) and under the “Map Input” tab for the displacement texture, select ‘Object’ and type in “Water”. It is CASE sensitive!
- The texture will now move with the empty so…
- Go to frame #1 ([Shift][Left Arrow]), Select the Water empty and press I->Loc
- Move up 50 frames ([up arrow] 10 times), move the water empty up on the Z-Axis about 10 units. Press [I] and save the LOC again.
- Make sure the empty is selected and, with your cursor in the 3D window, hit [Shift][F6] to bring up the IPO curves for the empty.
- Press the [Home] key on your keyboard to center the view.
- Select the LocZ curve (Probably Yellow), and then from the Curve menu, select Extend->Extrapolation.
*This makes the water move at that speed forever.
18 ) Switch back to 3D view by pressing [Shift][F5].
- Now render your animation to check the wave speed. If it’s too fast, simply go back to frame 51 where we made our second keyframe, move the empty down on the Z-axis, and resave the keyframe.
Now all you have to do is create a water material and set up some better lighting. Good Luck!
I’ve uploaded an example to my webspace: