The Triton Ocean SDK is designed to look great at typical fields of view – say, 30 – 45 degrees or so. But what happens if you’re simulating a telescope or magnified sensor, and use a really small field of view? Or, you have some sort of fisheye view with a field of view of 90 degrees or even more?
Normally, you only tell Triton about your projection matrix, and it’s tough for us to extract the actual field of view from it. As a result, you might not see much detail on the water when you’re zooming in to a spot out near the horizon, or there might be too much detail when you’re zoomed out to very high fields of view. The size of spray particles might also be affected, such that zoomed-in scenes have spray that’s too small, and zoomed-out scenes have spray that’s too large. Extreme fields of view can also mess up our algorithms for culling out wake effects with distance.
Fortunately, there’s an easy solution: use the Triton::Environment::SetZoomLevel() method! This tells Triton how to scale the detail in the scene to match the zoom level you’re trying to simulate. Each frame, call SetZoomLevel() with a factor that represents your field of view relative to some baseline. For example, if your “normal” field of view is 30 degrees and you zoom in to 3 degrees, you’d pass in a zoom level of 10.0. And if you zoom out to 90 degrees, the zoom level is 30/90 = 0.333.
By adjusting Environment::SetZoomLevel() as your field of view changes, you’ll ensure that Triton always shows the appropriate level of detail, wake effects, and particle sizes for any given FOV.