Waves

I’ve used Gerstner waves for the wave generation, this is basically a modified sine wave. You can find out more on GPU gems.

You can change four main parameters in a wave set, and it can be modified on the fly: Wavelength, Amplitude, Steepness, and Speed. The way I set these four values are for example:

I picked a value for Wavelength and Steepness.

Speed = √((Wavelength*Gravity)/2π)

Amplitude = Wavelength/(2π/Steepness)

Then I generated another set of waves with different parameters and I added them up.

For the ocean, I used 12 sets of waves, for the river and lake I used 4 sets.

How it looks on my test map with one set and 12 set of waves: