title: How to cheaply simulate water on iOS?
body: <p>First off, I'm not thinking about <a href="https://stackoverflow.com/questions/927714/iphone-quartz-how-to-get-a-water-effect">that</a>.</p>
  
  <p>I was wondering how to make a simple simulation of a waterfall onto some dunes on the iPhone.</p>
  
  <p>It turns out several people tackled the issue of <a href="http://forum.unity3d.com/threads/77263-Simple-Moving-Water-for-iOS" rel="nofollow noreferrer">moving water</a>, and GameDev has <a href="http://www.gamedev.net/page/resources/_/reference/programming/special-effects/water/the-water-effect-explained-r915" rel="nofollow noreferrer">approached</a> the <a href="http://www.gamedev.net/page/resources/_//feature/fprogramming/rendering-water-as-a-post-process-effect-r2642" rel="nofollow noreferrer">idea</a> several <a href="http://www.gamedev.net/page/resources/_/reference/programming/special-effects/water/realistic-natural-effect-rendering-water-i-r2138" rel="nofollow noreferrer">times</a>. However, all these solutions seems computationally intensive (and it makes sense, given water is a fluid and fluid mechanics is complicated). I'm interested in a shortcut, since it doesn't really matter the the simulation <em>be</em> accurate, but just that it <em>seems</em> accurate.</p>
  
  <p>Someone asked about simulating with (Navier-)<a href="https://stackoverflow.com/questions/6316307/directx-how-to-draw-smooth-2d-water-particle-based-water">Stokes on DirectX</a>, using 1500 particles. He states his result is jaggy. Of course, on iPhone it would be a OpenGL ES implementation of such a thing. </p>
  
  <p>Another good soul tried <a href="https://stackoverflow.com/questions/5478854/how-to-move-water-in-iphone-cocos2d">using Chipmunk's physics engine</a>, but it sounds to me like using a <a href="http://en.wikipedia.org/wiki/Main_battle_tank" rel="nofollow noreferrer">battletank</a> to kill a mosquito, and it still brings the issue of many, many particles. So I am now wondering if it would be reasonable to use a technique similar to  <a href="http://www.gamasutra.com/view/feature/3549/interview_the_making_of_dwarf_.php?page=9" rel="nofollow noreferrer">this pressure management technique</a>, in order to manage a macro-state of the fluid, and manage the edges with particles, in order to minimize the total calculations.</p>
  
  <p>If you have bright ideas, please suggest things to test.</p>
  
  <p>Edit 08/06/2015: I found into the <a href="http://blog.thimbleweedpark.com/mark_ferrari" rel="nofollow noreferrer">Thimbleweed Park</a> blog <a href="http://www.effectgames.com/demos/canvascycle/" rel="nofollow noreferrer">this great example of a very old technique done in HTML5</a> by Joseph Huckaby. It's only circumstantially relevant, because it's all about the look and not at all about the physics, but why not roughly simulate the fluid, and overlay the "liquid zones" with a palette cycling effect? Of course, since the technique relies much more on art elements, it moves the difficulty in the realm of artists. The rendering code however is a bit intensive when blending.</p>