© Square Enix © Goodbye Kansas


Table of Contents

This page offers a tutorial on using Houdini's Ocean Spectra with V-Ray.

 

Overview


SideFX have provided an amazing Oceans masterclass that can get you up to speed with using the Ocean toolset in Houdini, here: https://www.sidefx.com/tutorials/houdini-16-ocean-tools/

With V-Ray, we tried to stick to the workflow implemented by SideFX as closely as possible – therefore, there would only be marginal differences related to render engine specifics between V-Ray and Mantra/Karma. The major one being the file format for storing the spectra files – in the case of V-Ray, we implemented support for evaluating the spectra at render time when using the VDB file format to allow Standalone and cross-DCC compatibility.

To make it easier to follow along, we have provided a set of simple example files that cover the topics discussed below.

Note that support for the V-Ray Ocean Spectra texture is V-Ray 6 only.

Non-Solaris: for Motion Blur evaluation to work as expected, the displaced geometry has to have at least two object-level motion samples. The simplest way to achieve this is to add a couple of keyframes (with a tiny offset) on the Geomery node before the start, or after the end of the render sequence.

 

Download Example Files

 

 

Simple Spectrum with a Static Mask


In the most basic case of a single Ocean Spectrum and a static (non-animated) Mask, the setup is straightforward – the spectra are converted to VDBs using the "Convert VDB" SOP and exported using a "ROP Geometry Output".

 

 

 

Simple Spectrum with an Animated Mask


When working with Masks coming from animated geometry (whether transforming or deforming), it is a good idea to separate it from the spectrum files saved on disk. While per-frame spectra are supported, exporting them for every frame is unnecessary – a single file holds all the information needed to generate the animated wave patterns.

The simplest way to do this is by using the "Split" SOP with "@name=mask" condition. The Mask can then be exported for every frame of the sequence and loaded using the V-Ray Ocean Spectra Texture's "Mask Geometry" field.

 

 

 

Multiple Spectra


There is nothing particularly different here compared to using single spectra – the one caveat you may potentially have to workaround is the order of the Masks not matching the order of the Spectra that should be affected.

We are currently looking for a solution that will handle such cases automatically. Meanwhile, a potential solution is to export the individual spectra and their masks separately. Individual V-Ray Ocean Spectra textures can then be used to load them for adding together with e.g. the V-Ray Comp (Max) texture.

 

 

 

Wave Instancing


For patch/wave instancing, an additional step is required prior to export. This neccessity comes from the fact that a couple of crucial attributes ("planeorig" and "rolloff"), and the particle system holding the actual instance points, are lost when converting the spectra to VDBs.

To resolve this, one needs to use a "Split" SOP to isolate the points by e.g. "@name=pointmask" and use a "Convert VDB Points" SOP to pack them into a VDB volume.

Then, the "planeorig" and "rolloff" attributes are added back onto the newly created "pointmask" VDB.

Finally, the "pointmask" VDB is merged back to the spectra VDBs, and everything is exported to disk.

 

 

 

Rendering


To use the exported spectra VDBs, simply drop a "V-Ray Ocean Spectra" VOP and load them.

The Ocean Spectra texture has two outputs – "displace" and "cusp".

The "displace" output will give you the object-space displacement color that you can feed into a V-Ray Displacement VOP. For the Displacement VOP, the Type should be set to "Displacement (Object)", with "Use Bounds" enabled and the "Min/Max Bounds" set to -10 and 10, respectively.

The "cusp" output will generate a black and white mask for the wave peaks that can be used to drive shader parameters, e.g. by masking out the reflections and introducing diffuse into the water material.

Note that currently a "UV Channel Name" VOP is expected as an input for the V-Ray Ocean Spectra texture. It will sample the "uv" attribute that must also be present on the displaced surface.