JONSWAP wave model in Triton 2.1

JONSWAP wave model in Triton 2.1

Our Triton Ocean SDK just got a shot in the arm of extra realism.

Explaining how is a little bit technical. Triton creates its 3D ocean scenes by simulating literally tens of thousands of waves at once, and adding them together every frame. It uses a mathematical technique called an inverse fast Fourier transform (FFT) to do this at over 100 frames per second, and we use the resources of your graphics card to accelerate those FFT calculations even further.

How realistic an ocean scene looks depends a lot on the characteristics of those thousands of individual waves. How their wavelengths, amplitudes, and directions are distributed are key. Most people use what’s called a Philips spectrum to model this for real-time rendering; it’s fast, simple, and it’s easy to find examples on how to code it up.  However, it’s not the most realistic wave model out there.

Most real maritime simulations require the more sophisticated Pierson-Moskowitz model at a minimum. But, figuring out how to work it into an FFT-based water simulation isn’t easy. Some people fake it by using the Philips spectrum for the vast majority of the waves, and calculating just a handful of Pierson-Moskowitz waves that are added in to the final result. This results in discontinuities in the spectrum, and can slow down performance since you now have two different wave models to maintain.

An even better model is the JONSWAP spectrum (Joint North Sea Wave Observation Project.) This model builds upon the Pierson-Moskowitz model by simulating the effects of fetch length, which is how far the wind has blown before reaching the observer. Working that into a real-time rendering system is even more challenging.

But, we figured it out, and the results are something you need to see. Check out the video below. We’re really, really happy with how Triton’s waves look with these new spectral models – and the great part is that they have no cost at all on runtime performance due to how we implemented them.

With Triton 2.1, you can specify PIERSON_MOSKOWITZ or JONSWAP as a wave model in Ocean::Create(). To take full advantage of JONSWAP, you’ll also want to use the new WindFetch::SetFetchLength() method when setting up your wind.

We’ve also added the ability to add explicit swells in your scene. Not all waves are due to local wind conditions – sometimes,  you’ll get large swells from distant storms. The new Environment::AddSwell() method lets you add in as many swells to the scene as you’d like with any height, wavelength, and direction you want. And again, we’ve cracked the nut on working these swells right into our FFT inputs, so the runtime cost is non-existent.

Also check out the new Environment::SetDouglasSeaScale() method in Triton 2.1. This allows you specify separate conditions for wind waves and swells, according to the Douglas Sea Scale. For a really crazy scene, specify a wind sea state of 9 (“Phenomenal”) and a swell of 9 (“Confused Seas”.)

We are really happy with these new capabilities in Triton 2.1. We believe we have the most accurate, and the fastest 3D ocean wave solution on the market today – and usually “accurate” and “fast” don’t go together. Triton offers the physical realism required by training and simulation, and the speed required by video games in one package.