# C# Breaking ocean waves

## Recommended Posts

I am working on a project where I have to approximately simulate the ocean waves. Currently, I am using a mesh modification approach. I am able to simulate low amplitude waves using the following equation:

yVal = Mathf.Sin(180 * Mathf.Deg2Rad / freqUpdated + Time.time * speedOFWave) * halfWaveHeight;

Now, I want to extend this equation to simulate breaking waves for a high value of "wave height".

Approach tried:

1. I tried creating code similar to this plugin but the smooth transition between low amplitude waves to these breaking waves is not possible with that approach.

I have the following questions:

1. What kind of modification can be done to the above sin wave equation to simulate breaking waves?
2. Are there any other mathematical techniques that can simulate low amplitude and breaking waves?
3. Is it feasible to do this type of ocean simulation using water particles?

I would appreciate any suggestions and thoughts on this topic. Thank you.

##### Share on other sites

Yep, particle simulation is feasible i read. The surface on the open ocean is driven by the force, direction and fetch (length of effect) of the wind.

I can't (yet) help with programming these things, but breaking waves are rare on the open ocean, even if they tower many meters high due to strong winds that blow for many 100s of km. They occur at the transition between deep and shallow waters, where the orbital movement of water particles is compressed, e.g. near the continental shelves or in epicontinental or shallow seas. That's where the breaking news originate 🙂

Hydrological institutes and weather services have wave prediction models, maybe you can get more info there ...

Edited by Green_Baron

##### Share on other sites

Hi, not sure if you know but there are 4 great types of whater simulation:
(Navier-Stokes-based)
-Eulerian aproach (Jos Stam sable fluids and a few others are the main works regarding this 2D/3D)
-Shallow water equations (near shore waves and rivers 2.5D)
-Particle simulation (breacking waves, foam, etc)

(LBM-based somewat statistic-based approach)
Grid simulation with no breaking waves or other effects exclusive to particles

Fluid Simulation for Computer Graphics, Second Edition
code available for chapters of book 1 at
https://github.com/g-amador/incremental-fluids-java (I ported to java and include links to c++ original author code)

https://www.cs.ubc.ca/~rbridson/fluidsimulation/
http://matthias-mueller-fischer.ch/realtimephysics/

## Create an account

Register a new account

• ### Game Developer Survey

We are looking for qualified game developers to participate in a 10-minute online survey. Qualified participants will be offered a \$15 incentive for your time and insights. Click here to start!

• 17
• 18
• 25
• 20