The fluid solver used in the following post is based on Eugene Zatepyakin’s fluid solver, which you can read more about here. Eugene’s version is pretty damn impressive! his Alchemy version while running with 8000-9000 particles performs really well, sitting at about 50% frame budget in scout on my computer. Ever since first seeing the demo about a year ago I’ve wondered how far it could be pushed if it took advantage of Stage3D for the rending and Workers for the processing. Last weekend I had a bit of free time, so I decided to test just that.

The following example uses Eugene’s as3 fluid solver, however I’ve moved the processing out of the main swf and into a worker, which processes the fluid solving and passes back a Number Vector formatted x,y,z,w,x,y,z,w… etc… which is then pass directly into a vertex shader (well actually a number of vertex shaders, as each shader can only control 125 particles, due to the limited number of Vertex Constants). The result is 10,000 interact particles runing at 60fps.

[repo path=”peteshand/agal-fluid-solver-demo”]

Mobile version below: