Fabien Sanglard's non-blog
Fluid
February 23, 2011.
Cannot see the menu in Fluid2 ?
In Fluid2 the menu does not appear automatically: You can bring it up by pressing FIVE FINGERS simultaneously on the screen :) !
October 26th, 2011.iOS 5 iPad: Disabled "album" button :( !
I've received numerous emails mentioning Fluid and Fluid2's "Choose from album" button is disabled for iPad users. The issue has been identified and and updated version has been sent to Apple. It should be out shortly ;) !
April 12, 2011.iPad "Change background" bug
I've received numerous emails from users mentioning they cannot select a picture from an album since they updated to iOS 4.3.1. It seems the last update broke this feature, but I have fixed this issue now and submitted a new build to Apple, hopefully it will be approved soon.
July 02, 2010.iOS 4 crash :( !
I've received numerous emails mentioning Fluid and Fluid2 crash on second launch after updating to iOS 4. I've worked around the clock to generate a patch and it is now sent to Apple. I've also contacted the hotline so it will be considered an emergency fix. I keep my finger crossed it won't take too long to get to you guys.
June 29, 2009.Is "Fluid" too fast ?!
A few person emailed me since the released of "Fluid v1.3". It seems that it is running too fast now. The reason this issue was undetected is that I am doing all my testing on my personnal iPhone (First generation). Fluid v1.3 is using the optimized engine of "Fluid 2" but I did not notice the change until I saw the application running on my friend's 3GS.
The solution
I'm getting a 3GS from the Apple Store this afternoon, I will release a fix tonight: "Fluid v1.4" and "Fluid 2.1". The speed will be constant with ability to control it further via a slider. I hope Apple won't take forever to released them.
Screenshot of the upcoming update

June 9, 2009.
3,000,000 downloads...version 2.0 released !
I am very proud to announce the release of "Fluid 2" on the Appstore !
Check it out: 
More freedom on the menu:
- Ability to make a wish by throwing a coin in the water.
- Ability to change the color of that water.
- Ability to set the friction level.
- Option panel is now hidden by default.
- Lot and lot of bug fixes.



May 14, 2009.
1,000,000 downloads...version 1.2 coming !
Never I would have expected so many downloads. I've received numerous positive review for the version 1.1 of Fluid.
I'm working hard on fixing every bug reported, I just sent the version 1.2 to Apple:
- Background modification now works for any picture of any format.
- Music is no longer mandatory, iPod music will keep playing if you turn Fluid's music off.
- Music button never gets out of sync.
Next week, I will keep fixing bug in order to release a version 1.3...and also "Fluid Premium". Stay tuned.
May 9, 2009.
700,000 downloads...and counting !
Not bad for what was supposed to be just a "demo" during my job hunting process.
A lot of people have asked for a music and ability to change the background. Version 1.1 is currently being reviewed by Apple and will allow this:
- Option panel by pressing four fingers simultaneously.
- Ability to change background.
- Zen music ( Listen here).
- Support for multi-fingers.



April 15, 2009.
The actual stuff
|
I finally finished "Fluid", a FREE interactive water simulation for iPhone. While it is being reviewed by Apple, here is a short article describing how it's done....and the source code ;) ! Download for iphone:
|
Simulation
This water simulation uses a very old algorithm based on two heightmaps:
- Take the screen and slice it as a grid (the more slices, the better it looks). This is done via a double array (
int simulation1[][]), olding the height of each wave, - In order to animate, we will need an other array:
int simulation2[][], with the exact same dimension as simulation1. - To make everything move, use the following algorithm:
#define CURRENT_HEIGHTMAP (* simulation1)
#define PREVIUS_HEIGHTMAP (* simulation2)
for(x=1; x<=FLOTSIZE; x++)
for(y=1; y<=FLOTSIZE; y ++)
{
CURRENT_HEIGHTMAP[x][y] =
((PREVIUS_HEIGHTMAP[x-1][y]+
PREVIUS_HEIGHTMAP[x+1][y]+
PREVIUS_HEIGHTMAP[x][y-1]+
PREVIUS_HEIGHTMAP[x][y+1]) / 2) - CURRENT_HEIGHTMAP[x][y];
//Drag (otherwise water never stop moving)
CURRENT_HEIGHTMAP[x][y] -= CURRENT_HEIGHTMAP[x][y] * DRAG;
}
And that's it! Set an initial height perturbation in the last state, iterate at 30fps: Voila des vagues !
Rendition
From the heigthmap, we then generate a mesh. Assuming that every pixel ray come to the mesh at (0,0,-1), we can generate a perturbated View Vector. We use these pertubated vectors to offest the textures coordinates.
Performance
Right now, only reflection and refraction are simulated via a bottom texture and an environment map texture. The rendition requires two passes.
I tried to add the caustics but without multi texturing, this would have requiered a third pass, unafforable for now.
Running at 30fps:
- 179 200 fragments op/frame( 320 * 280 * 2).
- 13 680 vertices/frame. (6840 * 2)
- 6 960 faces/frame (3480 * 2)
Add a comment
Comments (91)
With fluid 2, it is impossible to change background with a picture taken with iPhone 4. Indeed, the screen becomes dark and fluid 2 is then totally impossible to revers back to one of the stones background. The only solution is to delete the application from the iPhone and then to reinstall it through tune.
I am disappointed!
regards,
Eric
Thanks for a great app.
You can access the option panel by pressing 5 fingers on the screen.
Regards,
Fabien
Hope to heat zoon. Looks very good i,m impressed!
1. Add more zen music (especially without the voice)
2. Give me the capability of adding (or attaching to) my own music.
Thank you very much
Greeetings Jonas Harms
You can access the option panel by pressing 5 fingers on the screen.
Regards,
Fabien
I find this app extraordinarily appealing and soothing, with one exception -- every time I start it up, the music comes on, even though I have set the switch to OFF and it shows up as OFF. So every time -- I have to go to the option panel (tap with all five fingers), turn the music ON, then back OFF. Next time I start the app, of course, the same thing all over, again and again and again. Make it stop!!!!!!!!!
I can only give it 3 stars because of this -- even considered a lower number -- but it would easily be 5 otherwise. [end of iTunes comment]
I have uninstalled the app and then re-installed it twice, but no change. I would use it much more often, but I am so annoyed at the music playing at this bug that I often avoid it.
I'm impressed.
Thank you
I've got the Fluid 2 and really love the realistic rendering of the water effect.
I wonder if you could point me to the "very old algorithm" you've used. Is OpenGL used in your app?
I'm thinking about adding water ripple effect to an app I will work on. Any light you shed on this will be highly appreciated.
Best regards,
Ming
I just got Fluid 2 after download, I able to turn it on to change the color.... After I confirm the color change I get out the program. When I get back, I won't able to see reset box....
Please kindly help!
Best, Ryan
I loved your blog about fluid app for iPhone. I didn't quite understand how you did it even with your explanation.
I hope to make an iPhone like ghis or ibeer but have no idea how to do it. Ibeer also simulates fluid.
Any advice or code would be gratefully received.
Thanks
David
I am unable to change the background dispute unistall and reinstall it's the same a requist to the developers please reassess and improve
Thanks
Great stuff as always, could you please make available the source for fluide available for download.
Thanks!!!!!
I have a great idea for fluid, though I am not a developer.
Saleh
Thank you,
KC
Tell hubby the name of the song is "ghost lullaby".
Also tell him he seems to have a keeper and he should treat her some champagne and flowers this week ;) !
Fluid2 only features enhancements. Everything you can do with Fluid you can do it with Fluid2.
You can access the menu with five fingers on the screen.
Fabien
Just i have buying Fluid 2 for iphone 4 but i don't get open settings.
I can't change the image..
What am i doing wrong?
Thanks
With fluid 2, it is impossible to change background with a picture taken with iPhone 4. Indeed, the screen becomes dark and fluid 2 is then totally impossible to revers back to one of the stones background. The only solution is to delete the application from the iPhone and then to reinstall it through tune.
I am disappointed!
regards,
Luciano
Still waiting for the source.. :)
The only improvement I can think of for the app is a timer, so that I can drift off to sleep while it's running.
Great work, thanks.
#define CURRENT_HEIGHTMAP (* simulation1)
#define PREVIUS_HEIGHTMAP (* simulation2)
in this can you give detail about simulation1 and simulation2?
Regards
Luis
Thx
Great product. Thank you very much for your efforts!
I've noticed that many have inquired about custom tunes but I've seen no response from you about this.
Are you planning on adding such functionality to the app?
I believe you would gain many new loyal customers if you did. :)
Best Regards,
Mikel
You can use your own songs by turning off the music in the application menu. For now I am not planning on shipping the app with more tunes as I haven't found anything Zen and copyright free.
You can press 5 fingers on the screen to get the menu back.
Fab
The android version is currently being developed.
Fabien
I just installed Fluid on my iPad 2. Love it. Very soothing and calming to watch those rippling effects to zen music in the background. I didn't upgrade to fluid 2 because I am not much of toss coin in wishing well kinda guy. But I would gladly pay if u have an enhanced version that allows me to puck one of my own zen or new age or ambient music files from my music library. Also, is there a way to make the rippling effect to last longer? I have to keep rippling the water every 2 - 3 seconds; kinda defeats the purpose of just sitting back and let yourself relax and unwind into a glassy stare into those rippling water effects n the sound of background zen music.
Regards,
Matthew
Your issue only came to my knowledge today and I will respond right away.
I think you are having trouble bringing the menu up, you need to press five fingers simultaneously on the screen to have this happen.
Once the menu is up you can select a type of coin a the bottom of the screen.
I hope this helps.
Fabien
For now the application is still generating some income. Even though I would absolutely love to share the code and knowledge I am cautious about some people that could just rip it with no respect for the original work.
I will release the source code at some point but I do not consider it an emergency since it is a very basic effect to implement for someone if they were to really try.
This is prolly not realistic, but, it would make a great lock screen or live background
I have the ipad 2
Take care an
As part of this project they have listed your app for use with iPad. We are seeking permission to use a screenshot of the app icon
Fluid
The icon will be used to provide identification. It accompanies the title and URL in the Mobile Devices document, which will be provided on this website: http://education.qld.gov.au/smartclassrooms/
We ask for your approval of our use of the icon.
Regards,
Mary
Would appreciate if it could be removed from 1 once the apps
have been paid for.
I love your image, and want to keep it but thought I could now try one of my own - as well - now it's bought.
Thank you
I am a developer, and just curious did u use 2D effects for the simulation or implement some algorithm of fluid simulation ?
amazing work
+ If you would please email it to my given email would be appreciated.
It's something unique and good. By looking at the water ripples it relax my mind .
Regards,
Samrat.
y want thi application in my comptuter its possible?
Nice work!