I'm not a wiz at shader coding, but I can tell you that Cg and HLSL are two seperate things. HLSL only works with DirectX, whereas, Cg works with DirectX and OpenGL. Normally shaders have to be written twice, once in HLSL and once in GLSL, if games want to support both DirectX and OpenGL, but Cg allows you to only write 1 as it works for both.
The shader in that article is written using HLSL. You don't necessarily need to know much about HLSL to be able to implement the shader since it is provided for you in its entirety. All you have to do is set the variables to the appropriate values.
Code:
heightMap – height-map used for waves generation as described in the section “Modifying existing geometry”
backBufferMap – current contents of the back buffer
positionMap – texture storing scene position vectors
normalMap – texture storing normal vectors for normal mapping as described in the section “The computation of normal vectors”
foamMap – texture containing foam – in my case it is a photo of foam converted to greyscale
reflectionMap – texture containing reflections rendered as described in the section “Reflection and refraction of light”
For instance, all these variables need are textures set to them. Although, most of them (backBufferMap, positionMap, normalMap, reflectionMap) are code-generated I'd imagine. However, all of these are probably already implemented in Esenthel's current shader code for water so that shouldn't be too much of a problem.
It could possibly be as easy as just swapping out the shaders and setting a texture to the foamMap variable as Esenthel doesn't use foam at the moment. However, you still have to have a paid license to be able to even try it, which I do not at the moment. Good luck to anyone who does!