The Triton Ocean SDK
This time, they’ve turned their attention toward real-time rendering of realistic ocean scenes, and as it was the case with SilverLining, the integration is easy and the visual quality, performance, and customer support was pretty good during our evaluation.
Triton allows C++ visual simulation developers to quickly add infinite oceans to their virtual environments running at hundreds of frames per second.
Serious Simulation Features
Triton isn’t just eye candy, it’s a real simulation and training technology with several features for ocean simulation hard to find in the COTS tool market. For maritime training and simulation, you need visuals that correlate with specific weather conditions and produce waves of the appropriate significant wave height, and the ability to match the motion of the ship to the wave conditions being simulated. Triton provides the ability to do both.
- Simulation of Wind Conditions – Application can specify any number of localized wind fetches of any velocity and direction, and Triton will automatically generate waves of an appropriate height.
- Simulation of Beaufort Scales – Alternately, any Beaufort scale number may be specified, and you’ll get a scene matching the sea state you specified.
- Geocentric / ECEF support – Triton works equally well in flat, spherical, or ellipsoidal Earth models such as WGS84. You can zoom out all the way to space, and Triton’s oceans will conform to the ellipsoid you specify – or zoom all the way to sea level, and the ocean will be properly oriented and lit.
- Correlation features – You can query the ocean height at any point by specifying a ray to intersect with the ocean, and use this to simulate floating objects that match the ocean visuals Triton generates.
Triton simulates thousands of waves at once at hundreds of frames per second on consumer-grade hardware, by using Fast Fourier Transforms (FFT) and parallel processing techniques. Triton detects what capabilities exist on the system, and will first look for general-purpose computation on graphics processing unit (GPGPU) capabilities to accelerate the FFT’s. OpenCL, CUDA, and DirectX11 Compute Shaders are all supported. Failing that, Triton will use Intel’s Integrated Performance Primitives to maximize use of multi-core CPU’s, and it uses OpenMP for further parallelization.
Another differentiating feature in Triton is its ability to render real-time ship Kelvin wakes. For each ship in your scene, it is sufficient to create a WakeGenerator class, and update its position and velocity each frame. Triton does the rest, rendering a wake trailing behind the ship that grows at the proper angle, displacing the ocean surface and generating foam and particle-based spray effects as well. In addition to the wakes for ships travelling in a straight line at a constant velocity, arbitrarily curved paths with accelerating or decelerating ships seem to be all handled properly by Triton.
Triton provides advanced reflection, foam, and spray effects for realistic ocean scenes. You can pass it a environmental cube map or a planar reflection map, and Triton will generate appropriate reflections in the water to match the rest of your scene. Foam is automatically created on steep wave surfaces, and the leading edge of wakes may optionally produce particle-based spray effects as well. The full Fresnel refraction equation is evaluated on the GPU for the best lighting realism.
Integration is rather straightforward, it is sufficient to initialize Triton for your coordinate system and environmental conditions, and then passing it your scene’s light and camera matrices each frame. A simplified example of initializing Triton for a WGS84 ellipsoid with OpenGL 2.0 looks like this:
resourceLoader = new Triton::ResourceLoader("..\\..\\resources\\"); environment = new Triton::Environment(); environment->Initialize(Triton::WGS84_ZUP, Triton::OPENGL_2_0, resourceLoader); environment->SetLicenseCode("Your license name", "Your license code"); // Set up wind of 10 m/s blowing North Triton::WindFetch wf; wf.SetWind(10.0, 0.0); environment->AddWindFetch(wf); ocean = Triton::Ocean::Create(environment, Triton::TESSENDORF);
Triton provides hooks for integrating with your own resource manager and memory manager as well. Updating Triton each frame is also just a few calls:
environment->SetDirectionalLight(lightPosition, Triton::Vector3(1.0, 1.0, 1.0)); environment->SetAmbientLight(Triton::Vector3(0.6, 0.9, 0.9); environment->SetCameraMatrix(modelview); environment->SetProjectionMatrix(projection); DWORD millis = timeGetTime(); ocean->Draw((double)millis * 0.001);
Triton’s documentation is available online and goes into more detail. Sample code is provided for integrating with OpenGL (2.x – 4.1), Direct3D9, Direct3D11, OpenSceneGraph, and Ogre. A second OpenSceneGraph sample is provided illustrating the use of planar reflection maps. You’ll find yourself up and running quickly, and Sundog provides a free evaluation version of Triton so you can ensure smooth integration before committing to a license purchase.
You’ll find a screenshot gallery for Triton and an interactive demo application at Sundog’s website, along with licensing information and contact info for any questions. If you’re looking to step up the looks and performance of your simulator’s ocean scenes, Triton is well worth a look.