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.
[kml_flashembed publishmethod=”static” fversion=”11.0.0″ movie=”https://peteshand.net/media/swfs/FluidSolver.swf” width=”1080″ height=”500″ targetclass=”flashmovie” menu=”false” scale=”noscale” salign=”tl” wmode=”direct” allowscriptaccess=”sameDomain”]
Mobile version below: