I’ve been doing some work lately on ocean simulation tools for Blender. It’s based on Drew Whitehouse’s open source Houdini Ocean Toolkit, and on a previous patch that was made for blender. A few years ago at ProMotion when we were working on a short film ‘Lighthouse’, we hired Hamed Zaghaghi to make a patch for blender 2.4x, converting the HOT code from C++ to C, and using it to drive a texture in blender, which could provide displacement and foam outputs. In the state we left it in, it was a big improvement over previously available methods such as animated noise, though it was a bit rough around the edges, and since then the code was mostly neglected due to lack of time and interest.
I was asked by Todd McIntosh of Resonance Media if I was interested in restoring what could be salvaged of the old code and re-integrating it as a new patch for Blender 2.5, as a freelance coding project. Todd was able to get a good deal of additional crowd-funding, which really enabled me to spend the required amount of time on this. I was able to reuse some of the old patch ( mostly the C conversion of the main engine) however there was a lot of extra work and re-work that needed to be done. A fair bit of time was spent on making the simulation/evaluation thread-safe, since Blender 2.5 is much more multithreaded than previously, and just dropping in the old code was very unstable. Now the simulator sits as a separate ‘library’ inside blender that can be accessed from other parts of the software, and from a user perspective, there is now a new Ocean modifier, that can either generate an ocean mesh from scratch, or displace an existing mesh. The modifier adds correct UVs and if required, vertex colours to represent foam, for visualisation in the 3d view. I’ve also brought in multithreading to the main simulation engine, using OpenMP after seeing some example code here. I’ve written up some documentation online in the blender wiki.
Among the new features there’s also functionality to bake the simulation results (displacement/normal/foam data) out to a sequence of OpenEXR files. One of the reasons for this is to allow integration with external renderers. The sequence above was rendered in 3Delight with my blender->3Delight render exporter, using such baked files, with custom shaders (more info on the vimeo page). I’m currently just finishing off some final tweaks and bug fixes, and hopefully the tools should be released freely quite soon.