The Houdini Ocean Toolkit (HOT) is a collection of dso’s and an OTL for rendering deep ocean waves using the algorithms of Jerry Tessendorf described in the SIGGRAPH 2004 course notes. The dso’s implement a SOP for displacing geometry and VEX functions for use in various Houdini contexts. The OTL contains a VOP that wraps the vex function. For the sake of convenience SOP_Cleave is also included in the HOT distribution (with Stuart Ramsden’s blessing).
Source and binary distributions can be downloaded from the houdini-ocean-toolkit repository on Google Code.
Note: the HOT binary distribution you install must match your version of Houdini. The VEX dso has a better chance of working across versions, but it’s still not recommended.
The latest pre-release version of code can be cloned from the mercurial repository on Google Code. You will need to have mercurial installed on your machine, see here for more.
Unzip the binary distribution into a convenient folder.
Linux and OSX
Add the new directory to the HOUDINI_PATH in your .bashrc or .cshrc according to which shell you use. So if you unzipped hotbin_linux_H10.0.374.zip into the directory /home/huser/stuff/hotbin_linux_H10.0.374 you would do the following -
export HOUDINI_PATH="/home/huser/stuff/hotbin_linux_H10.0.374;&"
Win32/Win64
As for Linux and OSX you will need to set a HOUDINI_PATH environment variable (right mouse and select My Computer>Properties>Advanced>Environment Variables). You will also need to put the dlls folder onto the PATH environment variable. E.g. if you unzipped hotbin_win32_H10.0.374.zip into c:\hotbin_win32_H10.0.374 you would set the following variables -
HOUDINI_PATH c:/hotbin_win32_H10.0.374;&
PATH c:\hotbin_win32_H10.0.374\dlls
Note: Don’t nuke your PATH if it already exists, prepend the above entry with a “;” between the entries.
Before building the HOT from source you must be able to successfully compile and install Houdini Development Kit (HDK) code. $HT/toolkit/samples/SOP/SOP_Star.C is a good one to try first. So before going any further try compiling the SOP_Star example with hcustom -
hcustom SOP_Star.C
For more information about using the HDK see the odforce wiki HDK page.
The build script should produce a zipped up binary package ready for installation or distribution.
Linux
The linux build is quite straight forward, building all the dependencies from source (included). To build, do the following in a terminal -
cd <where you put the HOT source>/src/3rdparty
./build_linux.sh
# now would be a good time for a cuppa ...
cd ..
python setup.py bdist
OSX
The OSX build is quite straight forward, building all the dependencies from source (included). You must have Apple’s Xcode development package installed. To build, do the following in a terminal -
cd <where you extracted the HOT source>/src/3rdparty
./build_osx.sh
# now would be a good time for a latte ...
cd ..
python setup.py bdist
Win32 and Win64
You must have VisualStudio 2005 installed and be able to use hcustom on houdini terminal to compile examples like SOP_Star.C in the $HT/samples/sop folder. We use hython here instead of python to pick up the right Windows architecture (32 or 64). -
> chdir <where you extracted the HOT source distribution>\\src
> hython setup.py bdist
My recipe for setting up Houdini and VisualStudio, you don’t strictly need to have folders without spaces, it just makes life easier!
custom install Houdini into a folder without spaces eg c:\apps\Houdini_10.0.374
custom install VisualStudio 2005 into c:\apps\VS8 (remember to select the extra 64 bit option for VC++ if you are compiling for win64)
then in a houdini terminal -
> set MSVCDir=C:\apps\VS8\VC > %MSVCDir%\vcvarsall.bat > rem or use the following instead for compiling 64 dll's > rem %MSVCDir%\vcvarsall.bat x64 > chdir \apps\Houdini_10.0.374\toolkit\samples\SOP > hcustom SOP_Star.Cyou should make a batch script to automate some of the above, or at least set MSVCDir as an environment variable
The Ocean SOP is a filter sop that displaces points in the up/y direction. See the sop_simple.hip example included in the distribution and play with the parameters to get a feel for how the SOP works. Note that the sop will calculate accurate normals if it is fed a geometry that has a normal attribute on points.

For a deeper understaning of the parameters see the Tessendorf notes.
The following VEX displacement shader illustrates how to use the ocean_eval() function included in the HOT. The functions arguments have exactly the same meaning as for the SOP. The ocean_eval() function is available in all contexts, so it can be used in vex sops, cops etc
Getting the right combination of parameters for the displacement can be fiddly, balancing wave height, chop, wind velocity etc so I’d recommend that you start building an ocean using an Ocean SOP and a single “Ocean Size” sized XZ plane grid. This way you can visualize the the surface as geometry, then when you’re happy with the look of the waves transfer the ocean sop’s parameters to a displacement shader thats applied to a large ocean plane geometry.
#pragma label gridres "Ocean Resolution"
#pragma range gridres 3 11
#pragma label ocean_size "Ocean Size"
#pragma range ocean_size 1 2000
#pragma label height_scale "Wave Height (approx)"
#pragma range height_scale 0.01 100.0
#pragma label do_chop Chop
#pragma hint do_chop toggle
#pragma label chop_amount "Chop Amount"
#pragma range chop_amount 0.1 10
#pragma label windspeed "Wind Speed"
#pragma range windspeed 0.0 100.0
#pragma label smallest_wave "Smallest Wave"
#pragma range smallest_wave 0.01 100
#pragma label winddirection "Wind Direction"
#pragma range winddirection 0 360
#pragma label align "Wind Alignment"
#pragma range align 1 10
#pragma label damp "Damp Reflections"
#pragma range damp 0 1
#pragma label do_eigenvalues "Export Eigenvalues"
#pragma hint do_eigenvalues toggle
#pragma hint jminus hidden
#pragma hint jplus hidden
#pragma hint eminus hidden
#pragma hint eplus hidden
displacement
ocean_displace(float time=0.0;
int gridres=7;
float ocean_size=50;
float height_scale=1.0;
float windspeed=30.0;
float smallest_wave=0.02;
float winddirection=0.0;
float damp = 0.5;
float align = 2.0;
float ocean_depth = 200.0;
int seed = 0;
int do_chop=0;
float chop_amount=1.0;
int do_eigenvalues=0;
export float jminus=0.0;
export float jplus=0.0;
export vector eminus={0,0,0};
export vector eplus={0,0,0};
)
{
vector disp,norm;
int do_norm = 1;
vector Po = wo_space(P);
ocean_eval(Po.x,Po.z,time,height_scale,
do_chop,chop_amount,disp,
do_norm,norm,
do_eigenvalues,jminus,jplus,eminus,eplus,
gridres,
ocean_size,
windspeed,
smallest_wave,
winddirection,
damp,
align,
ocean_depth,
seed);
if (do_chop)
{
Po += disp;
N = computenormal(P,ow_nspace(norm),Ng);
}
else
{
Po.y += disp.y;
N = ow_nspace(norm);
}
P = ow_space(Po);
}
Mostly used for debugging. Can be used from the COP context to save out the various quantities as images. i and j simply index into the arrays that are interpolated in ocean_eval(). The image dimension is 2^gridres.
The following example files are included in the distribution -

The simplest example (see sop_simple.hip) - the Ocean SOP with a lowres geometry (50m x 50m and 64 rows and columns) and no chop. This animates in near real time.

Using sop_simple.hip crank up the grid to 200 rows and columns, toggle chop and play around with the chop amount and wave height parameters to get this surface. Things slow down a bit.

Adding a surface shader that uses fresnel reflections and an environment map, things begin to look a bit more realistic.

Here we render a 10km square composed of 4 polygons with a vex displacement shader that calls ocean_eval(). The size of the ocean tile is 500m, rendered with the ocean “res” setting = 10.

The crests of the choppy waves are being colored by choosing the areas where the sign of the mininum eigenvalue (ME) is negative, and adding some color made from the negated ME multiplied by some noise. More sophisticated foam and spray can be driven with the minimal eigenvalue and eigenvector.
The toolkit is open source and copyright under the GNU GPL 2.0 license.
Send any questions and feedback to the Houdini Ocean Toolkit od[forum].