LiquidFun V1.1 Runs In A Browser
Written by David Conrad   
Thursday, 28 August 2014

We reported on Google's LiquidFun V1 earlier in the year as, as much fun as you can have without actual liquids getting involved. Now we have LiquidFun V1.1 and you can have as much fun in a browser.



LiquidFun is based on Box2D but with fluid and soft body simulation. It is written in C++ and makes use of OpenGL. Now with version 1.1 it has been compiled to JavaScript and it runs on WebGL in the browser. This means everyone can join in as long as their browser supports WebGL. The compile was performed with the ever amazing Emscripten and to show that it works and works fast enough to be taken seriously the testbed application has been ported and you can view it in your browser. The API to make use of it is the same in C++ or JavaScript. 

In case you aren't sure what a particle simulation is all you need to know is that you define the position and properties of a set of point particles and the program will animate them for you. If you don't apply constraints to keep the particles positioned relative to each other you get a fluid:



If you apply some constraints then the particles "flow" as solid elastic blobs and you have soft 2D objects:


If the two videos have piqued your interest then visit  LiquidFun and try the realtime demos out in your browser. Also try the games to see the sorts of things that you might use LiquidFun for. 


Also new is official support for iOS for the testbed and the EyeCandy app. The particle simulation has alsow been optimised and it can now make use of ARM NEON SIMD hardware if the device has it - A8 up. There are also lots of bug and stability fixes and new functions. 

There is also the provision of two open source games to show you have it is done - currently only available from the US Play store. VoltAir is a C++ platform game.



The second game is LiquidFun Paint which is written in Java to show you how to use the SWIG bindings. Given that SWIG is a development tool to allow a range of languages to work with C/C++ the chances are that the same techniques could be used for PHP, Perl or Python to name just the languages starting with P.




Since it was released LiquidFun has been use by a number of commercial games and built into examples of particle simulation.

Now that it is available as a JavaScript library and works in any browser the chances are that it is going to be even more popular. Given that the three big browsers - Firefox, Chrome and Safari all support WebGL now is the time to create a killer web app that involves people or things getting wet - or just bouncing around. 

As I said about versions 1 if seeing LiquidFun in action doesn't inspire you to write something I don't know what is going to get you moving. With advances like this there is a lot of mileage in 2D games even post-flappy bird.  


Running PostgreSQL Inside Your Browser With PGLite

Thanks to WebAssembly we can now enjoy PostgreSQL inside the browser so that we can build reactive, realtime, local-first apps directly on Postgres. PGLite is about to make this even easier.

The WinterJS Javascript Runtime Is Asking For Your Attention

WinterJS is a brand new Javascript runtime by Wasmer which comes with the claim that it's the fastest of them all. Let's find out if that holds true.

More News


raspberry pi books



or email your comment to:

Last Updated ( Thursday, 28 August 2014 )