Triton
Visual simulation library for ocean rendering.
|
Triton allows you to query the height and surface normals of the ocean at any given position; this allows you to simulate floating objects in your application consistently with Triton's waves.
In order to use intersection tests, you must create your Ocean object with the enableHeightTests parameter of Triton::Ocean::Create() set to true. By default, intersection tests are disabled, which allows Triton to avoid the performance hit of reading data back from the GPU on some systems.
With a properly constructed Triton::Ocean, simply call the Triton::Ocean::GetHeight() method at runtime to query the height and normal of the ocean surface at the intersection of a given ray and the ocean surface. For example:
The height returned will be accurate to within one grid vertex of the ocean mesh.
For the special case of intersection tests using rays that are oblique to the ocean surface, you may want to look at Triton::Ocean::GetWavesIntersection() instead for greater accuracy, at the cost of performance.