Triton
Visual simulation library for ocean rendering.
Simulating ship wakes with Triton

Triton includes the ability to displace the ocean surface in 3D with wakes generated by multiple ships, or more generally objects moving through the water.

In addition to the standard "Kelvin wake" of 19.46 degrees found behind ships moving at constant velocity in a straight line and a realistically modeled turbulent wake behind the propellers, Triton also properly handles ships that are accelerating, decelerating, or moving along arbitrary paths - all at constant framerates.

Including wakes in your simulation is simple. Just create a Triton::WakeGenerator object for every ship or object you wish to simulate in your scene, associated with the Triton::Ocean you'll attach it to.

Triton::WakeGenerator *ship = new Triton::WakeGenerator(ocean, parameters);
A WakeGenerator represents an object on the water that generates a wake as it moves,...
Definition: WakeGenerator.h:132
WakeGeneratorParameters contains the parameters required to construct a Triton::WakeGenerator object.
Definition: WakeGenerator.h:49

To take advantage of more advanced wake simulation features, you may pass additional information to the WakeGenerator constructor. For example, let's set up a wake for a ship that has a length of 100 meters with particle-based spray effects at the bow (100 meters ahead of the source of the wake), and a beam width of 20 meters. With this information, the turbulent wake behind the ship will expand at a realistic rate given the length and beam width of the ship, which may be useful for training purposes.

parameters.sprayEffects = true;
parameters.bowSprayOffset = 100.0;
parameters.beamWidth = 20.0;
parameters.length = 100.0;
Triton::WakeGenerator *ship = new Triton::WakeGenerator(ocean, parameters);
bool sprayEffects
Whether you wish this wake to emit spray particles originating from this wake generator.
Definition: WakeGenerator.h:57
double bowSprayOffset
Use this to have spray particles emitted from a point different from the ship position.
Definition: WakeGenerator.h:59
double length
The length of the object generating the wake.
Definition: WakeGenerator.h:85
double beamWidth
The width of the object generating the wake.
Definition: WakeGenerator.h:87

Then, each frame, update the ship propellers' position, direction, and velocity using Triton::WakeGenerator::Update(). The position is in world units, the velocity in world units per second, and the timestamp is in seconds. The direction is a normalized vector in world space.

Triton includes a preview tool that you may find useful in exploring the effects of the different wake settings, if you've installed our Windows SDK. You'll find a "Triton Preview Tool" application installed under the Triton SDK in your Start menu. This loads up a sample ship model and allows you to interactively adjust its wake parameters, along with the sea states and other Triton settings at runtime.

ship->Update(Triton::Vector3(shipX, shipY, shipZ), shipDirection, shipVelocity, now);
A 3D double-precision Vector class and its operations.
Definition: Vector3.h:36
void TRITONAPI Update(const Vector3 &pPosition, const Vector3 &pDirection, double pVelocity, double pTime, bool pDisableWash=false)
For any active WakeGenerator, this should be called every frame to update its position and velocity.

In C#, it works the same way - just observe the differences in syntax from C++. (Don't use *'s since you don't have pointers, use . instead of ::, etc.)

That's all there is to it! Once you stop calling Update on the WakeGenerator, any existing wakes will disspate over time. Just delete the WakeGenerator object when you're done with it, and make sure the Tirton::Ocean it's attached to is initialized and is not deleted during the WakeGenerator's lifetime. Make sure the velocity is realistic and accurate, in order to receive realistic and accurate wakes.

You may simulate as many WakeGenerators as you'd like in a scene. As the wakes are applied inside Triton's vertex programs, there are a finite amount of individual wake waves that may be drawn in any specific frame. Triton will select the waves closest to the camera if there are more waves being simulated that can be drawn at once. You may adjust this upper limit using the max-wake-waves settings in resources/Triton.config.

Note that the turbulent wake simulation may be taxing on some systems, as it is performed almost entirely on the GPU. If you experience poor performance when wakes are in the scene, try setting the value "wake-propeller-backwash" to "no" inside the file resources/Triton.config, and the propeller backwash behind ships will be disabled. Similarly, the 3D Kelvin wakes may also be disabled using the "wake-kelvin-wakes" setting. Disabling one or the other wake effects will significantly improve performance when wakes are visible, as will adjusting the max-wake-waves parameters for the renderer you are using.

Note also that 3D Kelvin wakes are disabled when using OpenGL on ATI/AMD cards. This is due to what appears to be a driver limitation. If you'd like to try using 3D Kelvin wakes on your AMD card anyhow, set the "disable-kelvin-wakes-AMD" setting in the resources/Triton.config file to "no".