I am doing my master’s thesis and have chosen to implement water ripple effect. The best example of what I am trying to achieve is: madebyevan.com/webgl-water/
This demo encompasses several effects as denoted by the author:
[li]Raytraced reflections and refractions
[/li][li]Analytic ambient occlusion
[/li][li]Heightfield water simulation
Currently, I want to implement the “Heightfield water simulation”. I’ve found lots of articles and discussions (cannot post them due to a restriction on the number of links that a forum topic could contain) but cannot see the most right way to implement it. Saw several physics formulas - model the water surface as an elastic membrane with low stiffness or use Navier-Stokes еquations. Most of the tutorials speak how to simulate arbitrarily moving water but not water ripples.
Could you point me to the most correct maths/physics and OpenGL practices for simulating water ripples?
Which means - add the average sum of all surrounding pixels, or vertices, and then subtract that of the center one. So, they probably initialize the mesh vertices’ heights using the “interesting function” and they later on modify the already initialized vertices’ heights. This leads to simulating water, not simulating water ripple. That is why I wrote:
Most of the tutorials speak how to simulate arbitrarily moving water but not water ripples.
So, this and another several tutorials were the first I saw. Then read someone speaking about sinc and sombrero functions, which are actually fading sin in 1D or 2D respectively. These are more close to what a math representation of a water ripple should look like. Here’s a sample code of the heightfield simulation you gave link about: www.roxlu.com/2013/024/height-field-simulation-on-gpu
It cites the same tutorial you gave link about but older I think: www.cs.ubc.ca/~rbridson/fluidsimulation/GameFluids2007.pdf
Probably, I should better read the tutorial becase this video illustrates the given heightfield effect: www.youtube.com/watch?v=mh4ouyoMlL8[/QUOTE]
The height map based approach does not explicitly deal with waves. Waves and ripples are an emergant propperty of the simulation. Those other things you mentioned
actually work with explicit matematically representations of waves.