Ocean Sim in H12.5 Part II

Another ocean test scene! In this instance my aim was, to test out using adding velocity to the H12.5 ocean setup, as by default only an initial velocity is created and as a result the ocean calms down quite quickly. I also wanted to have a look at procedurally generating and texturing the surrounding terrain. Click through to see pretty pictures and a breakdown of what I learned along the way.

Creating the Ocean

Ocean RnD - Render Test

Creating the ocean and changing the setup so that velocity was periodically added into the ocean to create waves turned out to be a relatively straightforward process. The ocean evaluate node creates a velocity volume which can be transferred onto the points using a point wrangle SOP.

The velocity on the points was then shaped a bit in SOPs so that it tapered off as the water got shallower. Also the velocity on the points was multiplied so that it was added periodically rather then constantly. Finally the velocity from these points can then be brought into DOPs using the field force node.

Overall this worked pretty well, although getting the balance between making the waves too fast at the start (exploding ocean!) and not adding enough velocity to drive the simulation after the initial surge was pretty fiddly. It took a fair bit of tweaking to arrive at the result in the video.

Rocks and modelling with Open VDB

Ocean RnD - GL

Pretty much the entire scene was modelled procedurally, only the ground and the rough outline of the cliffs were modelled manually. The base rock shapes were created by using copy stamping noise onto a sphere (by simply varying the offset of the noise) in order to around fifty variations of rock. Points were then scattered inside the volume of the cliff shapes and the rocks were copied on. The resulting mesh was then converted to a volume using the polygon to VDB node. Converting the geometry to VDB not only removes the inside surfaces, but also has a couple of nice workflow advantages:

  1. It allowed the easy and efficient generation of collision geometry for DOPs. Rather than having to deal with a fairly high res polygon mesh we can just use resample VDB node to create a low res approximation of the geometry and bring that into DOPs as a collision field. This is much faster to calculate and means you can get relatively detailed collisions (and not have to worry about the collision volume representation).
  2. Similarly it also meant that creating proxy geometry for the viewport display was relatively straightforward; once again the high res volume was simply resampled to a lower resolution. Given the detail of the sim, having a really low res preview of the rocks was key in keeping the viewport GL workable.
  3. It was also really easy to generate varying resolutions of final geometry by either resampling the high res volume, or by adjusting the adaptivity of the convert vdb node. This gives you pretty good control over the output mesh and allows you to capture the detail of the volume representation without ending up with an unworkable poly count.1
  4. And finally the output geometry was converted into a polysoup which meant that the geometry, while relatively heavy, was still memory efficient.

Ocean RnD - VDB

In terms of using the Open VDB tools in Houdini, this project only really touched upon the surface of what if possible with them, and I’ll hopefully get around to looking at them in greater depth soon.

Rendering Woes

This is where things went slightly awry. As this was just a personal test, all I had available in terms of computing power was my MacBook Pro, which although pretty quick is somewhat under specced for this kind of scene. While the individual elements would render in a relatively quick space of time, rendering them together proved to be prohibitively expensive. This was primarily due to the reflection on the water; reflecting the interior volume / spray and foam caused a significant slow down.

More positively, given the complexity of the scene, with millions of particles, reflections, multiple volumes and displacement, all existing in the same scene, the PBR render engine looked as if it would do a pretty good job in handling the challenge if it came to rendering this kind of thing in production. Below is an initial test render with most of the elements in the scene (bar mist) and with wet maps created for the rocks and beach.

Ocean RnD - LookDev

In terms of shading the scene was relatively straight forward; the rocks were textured by layering Houdini’s built in patterns, and areas of grass/dirt were created by using the dot product of the normal. This was all plugged into a surface shader with a bit of displacement. Initially I had intended to add grass as well, however that did horrible things to the memory usage, which was already pretty constrained.

Anyways, all in all, this was an interesting little project to look at the Open VDB toolset and further explore the new Ocean tools in H12.5. Any questions? Feel free to ask in the comments :)

  1. It is worth noting that newer releases of the Open VDB tools have improvements on how sharp edges are filtered (amongst other things). I’m assuming that this is going to make it into H13, but if you’re feeling adventurous you can download and compile the plugins from the Open VDB web site.
About these ads

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s