Ocean Storm
This shot was my first personal project constructed entirely within houdini and composed in shake. Its core elements were created in Houdini using a variety of SOPs, POPs, VOPs and COPs (explanation). The following is a breakdown of the methods I followed to complete this shot and hopefully contains some useful information for others who are new to houdini.
1. Ocean Geometry
The base of the ocean was built using the Houdini Ocean Toolkit (HOT), which provided me with a great starting point and a number of useful attributes embedded in the mesh sequence. Sifting through the accompanying .hip files was a valuable learning experience and I highly recommend taking a look if you are considering building an ocean surface. The ocean geometry was then deformed using a number of expression driven metaballs and a magnet SOP in order to create the faint swirling ocean deformation around the water spout. The geometry was then passed through a simple CHOPs network in order to apply an exponential decay on the y axis to give the appearance of waves stretching off into the distance.CHOPS Network:

Expression used within the "express1" node: 1-$I/icl(0)*$I/icl(0)+0.2
- the $I is the current index local variable and the icl expression will return the length of samples in the input geometry. These values multiplied together provide the exponential decay and the 0.2 value appended to the end allows minimal wave motion on the horizon. The math node then simply multiplys the original CHOP with the Expression CHOP.
2. Ocean Foam
The foam appearing on the cusps of the ocean geometry is the resut of applying various noise octaves to the minimum eigenvalue attribute in a VOPs shader. This eigenvalue generated from a jacobian matrix in the HOT can display the crest areas of the ocean surface for foam emission. It is also described in Jerry Tessendorf's 2004 siggraph paper as being used for the choppy waves algorithm implemented in this shot.Shaders in Houdini have complete access to any attributes defined within a scene and can be accessed within the shader by creating a Parameter VOP and in the name field entering the case sensitive attribute name you wish to access. You can see any attributes you have access to in your scene by middle clicking on any node within the network view. The number within the square brackets following the attribute indicates the data type, i.e. scaler = "[1]", vector = "[3]"
By default, plugging the eigenvalue attribute directly (after a float to vector conversion) into the Cd (diffuse colour) output of the surface shader will provide you with an image where the peaks are darker shades of grey and the troughs are lighter shades of grey. I used a "fit range" VOP to invert this and constrain the brighter values to the wave peaks. This was then multiplied by various noise generating VOPs to create the appearance of white wash. This whole procedure was repeated with different opacities and noise frequencies for several layers of foam.
3. Ocean Surface
The ocean surface shader computes a number of seperate passes for diffuse, ambient, environment, specular and fresnel reflections. The lambert, specular and fresnel, lighting VOPs take the normalised incident vector (direction from eye to surface) and normal vector and automatically determine the colour values by taking into account lights used within the scene which have been set to contribute to diffuse and/or specular.
Parameters can be created and then exported at any stage in the VOPs shader, by simply creating a parameter, setting the export option to always and wiring into it at any stage of the network that you wish to generate an attribute. These attributes can be shared by other shaders within the same material as they are by default in world (camera) space. The order of execution of shaders within a material commences with the displacement shader, followed by surface shaders, then atmospheric (fog) shaders which run alongside light and shadow shaders to determine the illumination of a scene. The following is an example of the fresnel section of my shader which is exported to a VEX variable called "fresnel" (highlighted in green). This can then be accessed by mantra and rendered as an AOV by adding an extra output image plane within the Mantra node and typing the attribute name into the VEX variable field.

4. Ocean Spray
Various layers of spray were create to simulate water particles being blown across the cusps of the waves. The initial layer of spray was emitted around the twister. This was a fairly dense number of particles and points were grouped on the ocean surface as the source of this emission based on an area defined by a color attribute constrained using a metaball, coupled with the eigenvalues on the cusp of the waves. These particles were then given a swirling motion by using a VOP POP to modify the normals by computing the cross product of the up vector and normals per particle which was then used to drive the velocity with a slight dampening.The other layer of spray was emitted from randomised locations on a limited portion of the eigenvalue cusp of the waves. This simulation was constrained primarily within the view of the camera frustum to save CPU cycles.
5. Twister
The twister or water spout is a sprite based funnel created using a variety of attributes and expressions driving the mass, rotation and scale of particles in a POP network. The POP network creates an attribute to randomize the mass of each particle that is emitted. This means that when centrifugal forces are then applied the lighter particles will travel the greatest distance outwards from the y axis. After using a property POP to activate the new $CMASS attribute, it can then be used to drive the scale and opacity of the sprites to make the outer particles of the twister larger and more transparent. A $CSCALE attribute was also created which uses the $LIFE local variable to increase the scale of sprites as the particles age. This is then mutiplied by the inverse of the $CMASS attribute to make the scale of lighter particles on the outskirts of the twister larger than heavier particles closer to the centre of the twister. A color node can be used in the POP network to visualise any attributes that have been created.
The VOPs shader used is a similar network to that described in the 3dbuzz training VTM's and Miguel Perez's implementation. In order to use sprites mapped to each particle in an a geometry object you have to use a sprite procedural geometry shader and any attributes you wish to apply to your sprites such as Cd and Alpha need to be included in the attributes field of the geometry shader. The geometry and surface shaders then have to be linked to the object at the geometry level in order for the sprites to be rendered.


The emitter was wired into the first input and the metaballs with forces appled were wired into the second input of the pop network. An attractor POP was used within the POP network to apply the metaball forces. This procedure was repeated with varying forces and attribute values applied to create several layers of smoke and spray.
6. Composition
In addition to all the standard layers which were rendered using exported attributes in the shader, a z depth sequence of the ocean was rendered in order to apply accurate falloff effects in comp. To generate the z depth sequence, the Pz (position of z in distance from the camera) was wired into the Cf (surface colour output) of a simple surface shader. I then linked this shader to a material sop chained directly after the initial ocean geometry and rendered the sequence.
The output sequence of files are by default floating point images that have not been normalised. The pixel value is represented as an incremental level of brightness for each unit away from the camera. This range can easily be adjusted in COPs in order to see the greyscale falloff by applying an equalize COP to the .pic sequence and rendering out as 8 bit images.
