I want to render an ocean where players can change waves’ amplitude in real-time. Initially, I would render rolling waves (see picture). As the amplitude increases, I need to transition the rolling waves into breaking waves (see picture). For now, I am not going to show the shoreline onscreen so I don’t need to render breaking waves interacting with the shoreline; I only need breaking waves on the open ocean.
I’ve tried three different approaches so far and I’ve only had success with rolling waves using approach 1. Breaking waves have been impossible so far with all three approaches.
Approach 1: Mesh deformation
- I can create smooth rolling waves using the Sine and Gerstner equations.
- Since I can’t use these equations for breaking waves, I tried to implement them by using this free plugin whose output is similar to this paid mesh deformation plugin. But there are 2 problems with this plugin approach:
Problem 1: There is no smooth transition between rolling waves generated by approach 1a and the breaking waves generated by the Deform plugin
Problem 2: The output of the plugin does not look similar to real breaking ocean waves in three different ways:
i. No smooth blending with the ocean surface
ii. A large depression is created below the crest
iii. The entire wave is the same height (rather than with more realistic variations)
- I considered using vertex shaders but this approach seems similar to mesh deformation.
Approach 2: Fluid dynamics + metaballs
- To render an ocean I will need thousands of particles which will be too expensive in terms of performance (especially for mobile devices).
Approach 3: Using mesh files
- I can create breaking waves using some 3D software like in this post but then I can’t modify the ocean in real-time. It will be more like a pre-rendered simulation.
To summarize, I am looking for an approach where I can vary ocean waves’ amplitude for a smooth transition between rolling waves and breaking waves.