Thursday, October 25, 2007


Just to let anyone know that may care. I'm still waiting for feedback on the current state of the plugin before I update to the new version.

Also a few comments on what people get wrong.
  • Yes you do need to divide the meshes up finely. But not that fine. As long as each vertex is about a particle size away your fine. I have seen some meshes with 10k+ vertex's. Thats too fine unless particle size is smaller that .001
  • Normals pointing in the wrong direction. It seems that there are few issues with normals. Use approximated polygon objects, convert to triangle mesh and then set smooth shading.
  • You need a lot of particles to get a "good" fluid. 10,000 is not a lot. Rendering time still dominate in my experience.
  • Time steps are too large. If the fluid just disappears, its because the simulation blew up.
So unless i get comments to the contrary I will work on the following.
  1. Remove the need for subdivided meshes. This should fix the normal problems too. This is however quite a bit of code.
  2. Some small adjustments to the GUI, but they won't be big. Yet.
  3. Try to get some adaptive time steps in there. This will be a experimental feature.
Please keep the feedback coming.

Monday, October 01, 2007

Beta 0.6

The servers are still down and could be for a while. But i found a good file sharing site mediafire. It works on all the browsers i tried (Ok it didn't work with lynx) and didn't swamp me with popups. Nik is going to also host the main jar as well (Thanks). Watch out for his link latter.

So there are big changes with the beta 0.6. Most are behind the scenes to get everything ready for other physics and particle work. Rigid body and softbodys should not be that far away, and including them with this makes fluid interaction much easier. Also gases and fluid driven Materials and textures (for the procedural texture/material editor) will also be not too far away.

But for the current uses heres the bugs that will impact you the most:
  1. Found and fixed a bug in the find neighbors code. Now you can use larger time steps and not blow up.
  2. Found and fixed a density calculation bug when the spacing parameter is smaller than about 1.2. Now any spacing parameter less than 2 can be specified.
  3. Some bugs in the thread code that lead to things being done twice on dual core machines was fixed.
  4. XSPH bugs were fixed and is now exposed to users.
  5. Many more i can't remember.
Some things that I have not yet fixed:
  1. The flash/flicker that some have seen in rendering is almost defiantly a thread issue. Where it renders a next frame before the data for that frame is loaded properly.
  2. It is still difficult to get a "smooth" surface to the fluid. This may require a lot of work to fix properly. Some surface tracking methods are more complicated that the fluid simulation. We will see how it pans out.
The big things added:
  1. Mesh previewer. Its is however slow and not that accurate for the resolution. Its not adaptive and will scale with the bounding box. Also you might want to turn it off when you render a ray traced movie.
  2. Sampled Grid to speed up ray tracing. On very simple scenes on the dual core machine at home there is almost no improvement. But when AA or extra lights are added this starts to change quickly. At work on a slower single core machine its about 2x faster with java 1.6 and about 5x faster with java 1.5. Note that you get very weird results if Sample Grid factor is too small. 4 or larger are fine. Too large and you spend a lot of time building the sampled grid. Note this does not use a tree so the grid build time scales with the volume of fluid. This should make it fast enough to render transparent fluids.
  3. Improved GUI for object management. Again its not finished, but its easier to use both for a user and a coder.
Unfortunately this has added a issue or two:
  • Sometimes a when you load a file and raytrace it there is no fluid. I can't locate the bug yet but a workaround is to turn on the sampled grid (under preview/view tab) render and then turn it off again. Preview renders seem to give you a good idea of whats going on.
  • What little documentation there was is now largely wrong. There is no other documentation at this stage.
  • The mesh preview will rarely have a large missing strip on it. The fix is to either move the physics object very very slightly (The fluid won't move because its in world coordinates) or add a small about to the mesh size under the preview/view panel to not be a whole fraction or multiple of the particle size. ie mesh size = 0.050001.
  • Previous save files will not load properly with this version. However AoI is robust and will load everything else and you will just need to delete the not loaded physics and add a new one and configure and save.

Quite a long list here. I will try to now just comment of a few catches when using the plugin.
  1. When you change parameters like particles size. You must reset the simulation and rebake. If you don't the simulation can blow up no matter how small the step size. Generally if in doubt rebake.
  2. If you bake a simulation but did not save the parameters set, then when loaded from a save file everything can be inconstant eg. particle size, and hence raytraces and meshes will be wrong.
  3. Use lots of particles for realistic effects and use a high density threshold for emitters. The advanced option of spacing can be reduced, but will increase simulation time.
  4. ensure that all boundary and emitter meshes are subdivied enough and that the smoothing method is set to shading.
  5. If you try XSPH reduce the step size.
So where are the files:
The plugin is the Physics.jar file.
Everything will move to the server I was using before when its back online. And don't forget. Its still a beta.

Saturday, September 29, 2007

Downed Servers.

Unfortunately the raid (So much for redundant) of our server at work has died. I can get no word on when it will be fixed. 1 week tops. Very sorry about this. I might put the files in some temp place for a week or so.

Monday, September 24, 2007


The Plugin has been updated. So this is version 0.51. Don't forget you need java 1.5.
So what was done?
  1. Fixed a bug in the bake file saving code. Now you shouldn't get "stuck" as was happening before.
  2. Found and fixed 2 bugs in the simulation code. It now should be more accurate. Note that in the advanced options you can select a single pass simulation mode. It might be faster, it will certainly be less accurate and may need smaller time steps.
  3. Implemented a direct gradient finder for the ray tracer.
  4. Provided a good default for max gradient. This makes ray tracing much faster. You might get some rendering artifacts however. Just increase the max density adjustment under the views and previews panel. Thanks goes to Peter for implementing this suggestion so quickly.
  5. Fixed a another bug in the bake file saving where the y velocity component was getting placed on both the y and z axis. This would cause rebakes to be totally incorrect.
  6. The coordinate system is now world coordinates, not the physics plugin local coordinates. This will change the direction gravity acts. Default is the -z direction.
  7. Moving between frames with a lot of particles was very slow. This has been somewhat fixed and should be a lot faster now.
So because of these bugs you should update ASAP. Here are some results from the debug process when its all pear shaped.


Render. Problem!

Now it works and only 12 mins to render.

Don't forget with these render times that I have a AMD X2 5000 and use java 1.6 (about 1.5x faster than 1.5). The simulation time was under 10 mins, but i don't remember exactly how long it was. Also the simulation code is single threaded at this time.

And almost forgot. The Plugin is in the same place. Here

Saturday, September 15, 2007

Good news everyone....

Think the Professor from Futurama when you read the title.

Yep. The beta 0.5 is out. However the documentation is even more sparse than I would like. Remember this really is a beta.

Basic HTML getting started

PDF of the same thing

Failed attempt at a Flash tut I used wink, unfortunately screen grabs when a menu is selected/pulled down does not work. So its not so good. But maybe it will help someone.

Image dump of the above flash. Warning, quite large.

And finally the link you are all waiting for:
The Plugin and it comes with the whole No warranty deal.

And finally I forgot one very important thing. Trying to ray trace transparent materials will be Really Really slow (Glacial speed). This will be fixed at a later time. Also in the mean time report bugs at the AoI source forge forums.

Wednesday, September 12, 2007

No posts does not mean zero progress

Well something like that anyway. I have been working away at the plugin. First of all we have added everything for the 0.5 beta release. I just need to fix the last few bugs that bug me. Secondly I'm moving the plugin over to the AoI 2.5 format. So when will it be ready? Well soon.

Last weekend I just got sick of computers and took my family to Venice for the weekend. It was nice and much cheaper than i thought it would be. This weekend could be the weekend. Lets hope.

Friday, July 13, 2007


An antibug is a bug that combines with another bug and "fixes" it. Last night I found quite a few bugs and then had to spend most of the night finding the corresponding antibugs. These were infact quite big bugs in the sense that they where mathematical in nature. So if the size of the particles was changed, the results were quite simply wrong. Fixing this has meant some performance improvements as well. Unfortunately it means I didn't finish the plugin to a beta 0.5 yet. Also I have two more things to add to the list of todo's. Firstly I want to put in the advanced Options and a "reset" button.

So here is the suface version of the jump with the old code:
Old code Jump

Here is a new version of the jump with the fixed code:
New code Jump
New code Jump, Side View

Thursday, July 12, 2007

Reading the tea

So I hit the literature last night too see how much the field has progressed. How surfaces are generally done and incompressible SPH. There is finally a few papers on divergence free projection methods out there now. Because this has been used with other methods espisally for visually effects where accuracy is not so important (aka RealFlow I think) I was surprised that it took so long to be implemented with SPH.

In the future I will probably implement a divergence free fluid solver (via projection) as this will allow for very large time steps and allows for "vortex forcing", that is make the fluid more turbulent which is often the desired visual effect. As for surface tracking I will probably try a "colour" method to determine the normal at the surface. The unnormalized normal is a proxy measure of distance from the surface which provides a nice way to integrate with the isosurface solver in AoI.

Oh and here is a full simulation of the bent channel flow. It took 8 hours and has a maximum of 20000 particles with another 10000 boundary particles. This should be perhaps a bit faster really.
Zigging and Zaging
IsoSurface render

I also did a hydraulic jump. The iso render is cooking.
Jumping fluid

The reference to tea is because I cannot drink the large amounts of coffee I would usually drink. So now its lots of tea......

Wednesday, July 11, 2007

Final Beta 0.5 Stages

To my surprise I got to spend about 6 hours on the code yesterday. This was enough to get real close to a releasable beta.

What was added:
  • Moving fluid inflow
  • Moving fluid outflow
  • Improved GUI
  • Bounds parameter (removes particles outside the bound)
  • Max particle parameter
  • re-coded the interface between GUI objects and fluid Solver Objects
What needs to be done:
  • Add support for save and load.
  • Fix some minor bugs
  • Documentation. You will need some to use the beta (perhaps alpha?)
  • Add some parameters to the GUI, like max particle count.
  • Add tool tips. Makes docs easier.
There are some other issues that have come to light. First is that there will need to be some serious improvement on the surface representation to get a nice look. This could be some work and will be done later. Secondly without adaptive time steps there are large performance issues. In particular I want to add adaptive time steps both in time and space.

So the 2nd Generation Fluid solver will have adaptive time steps and support for multi core CPU's and will be what I work on after the beta release. The new surface stuff will need to be later. We will see. Anyway heres some movies of the latest incarnation of the plug in.

Ugly Surfaces
Same as above in preview mode(15MB)
30000 particles is a bit slow

Saturday, July 07, 2007


I have had a sore stomach for some time. It finally got bad enough that I couldn't go to work and had to see a doctor. To make a long story short I got my appendix removed, and spent most of last week in hospital. The good news is that the Austrian Health system is fantastic. All up its going to cost me 30 Euros!!. Seems I got lucky and went to one of the better Hospitals.

Of course the bad news is that work is now further behind along with the fluids plugin. I was hoping to do some while I was away from work. But unfortunately It looks like that won't happen. Sorry. There isn't much to do for a beta. But its still not ready. The goal is to be at version 1.0 by the end of the year.

I'm very sorry it won't be sooner. But quite a few things have gone a little pear shaped this year so far. Nothing serious of course, well not too serious, but enough that things just don't get finished when we wanted.

So thanks for all the comments, they do help. All i can say about the beta is that it will be out before duke nukem forever.

Sunday, June 10, 2007

Edging closer

I managed to write some code. Create some regresion bugs and then fix them. Here are the short movies. There are quite a few "bugs" that you can see in these movies, however thay are perfectly normal and with high resolution meshes and fluids you won't have problems with them.

Preview renders
A few seconds with the ray tracer

Note that the liquid surface needs work. This will come later.

Friday, May 04, 2007


Very sorry for the lack of updates. I knew that march and April would be a write off. May is looking that way too unfortunately. This is why I tried to get it out in feb, since long delays were going to be the order of the day otherwise. Frankly I'm surprised that I have not had a few more "bumps" from the AoI users.

So I want to make one thing very clear. Its fine to request info on updates. Its makes a big difference on what in my spare time gets the time. I would like to say that I'm a super disciplined machine with great work/fun allocation skills. However I'm not. So don't feel you can't keep asking whats going on.

The other thing I want to make clear, is that it will get finished to version 1. I will push it that far and then open up the source. I may take to the end of the year, but it will get there.

Oh and just in case your interested. I have been teaching and writing for work. Also add some unprodctivness in there as well.

Thursday, April 05, 2007


So for the first beta there is going to be a lot of options. For the most part folk won't want to adjust them, however they should provide work arounds for most problems you will encounter. In particular since I still don't have adptive steps there is the problem of choosing small enough step sizes, otherwise the fluid blows up, more or less.

There is still a bit to do. I need to put in motion avraging code, theres the partical density and the scale factor to add. Also there is some code cleaning to do. At this point I will stick with the main AoI realease and work with the new beta stuff later. As a result renders are a little slower than they need to be at this point.

Same slosh without the box and using the raytracer

Wednesday, April 04, 2007


Been working on the GUI again. Its getting there. It won't be finished by a 0.5 beta but then again I want some feed back on the general GUI design. Hoping to make some serious progress over easter. Although I have 6 hours of leasons to get ready. Heres the latest Vid.

Slosh in a Box

Friday, March 09, 2007

Moving along

Don't panic. There is progress. However I do have a life outside this hobby and that has been getting more attention recently.

First of all work has been getting further and further behind. But with a very focused 2 weeks Its all back on track. However there still a lot to do to finish the paper I'm working on.

The second reason is that I can get 11 euro train tickets to anywhere in Austria on staurdays till the end of march. We are using that big time. Last week we went to Saltzburg, this week were are off to Gratz. It nice to finnaly get out of Wien.

To follow that we finally got some cheap flights to Brussles. We are there for 2 days plus one day in Paris via the train. I promised Jayne and Jordan that we would see Europe while we are here, and after almost a year I'm starting to make good on that promise.

As for the fluid code. Its manily a staurday affair, so it has not got the attention lattly. But don't worry I have been working on and I do have some more movies. I wanted something out in feb and now its march. I won't give a data at this stage for a beta 0.5 release. But it should be sooner rather than later.

Monday, February 12, 2007

Moving Things Around

As I have had to revise the boundary condition code I thought I would test what does and doesn't work with moving boundaries. The big problem is always whats stable and whats accurate. Often getting both features can be tricky.

Originally I would use the velocity vector to provide a force that would then alter the velocity. Unfortunately if more than one "piece" of boundary was interacting with the particle the final velocity could be unbounded. Clearly not a ideal solution. However it did fit into the work flow better than other methods.

I have tried reflected particles and just "dead" boundary particles but have found both solutions somewhat lacking. Both are very slow, and treating density correctly is not as straightforward as it appears. Usually very small time steps are required.

Finally we have the method I'm now settled on. First we use the distance not from the boundary point but from the boundary plane that the point represents. Secondly we use a special step to update the velocity. In that the boundary only affects the velocity and only at fixed time in the update schedule. It give very nice bounded results as shown below in the movies.

There are a few points to consider however. First is that each boundary particle can affect the fluid. This means that the boundary behaviour is determined by how many particles are used to make up that boundary. Secondly there is no bounce, although that can be easily added at a later time.

So the movies consist of the same animation. One with the velocity vectors and the other with the isosurface. The tub that the water is being poured is set to hidden and the paddle does penetrate the tub. When the paddle "squished" the water between the wall and the tub, we see squirt of water. This is where the simulations would go unstable with other boundary condtions. However it should be noted that this "squish" will be very sensitive to parameters, and it will still be possible to send this into unstable regions with sufficient squishing.

Movies of moving paddle:
Raytraced Isosurface
Velocity Vector preview

Friday, February 09, 2007

Huston- we have a problem.

Yep. I have been just blindly using my fluid code that i devloped in NZ. Unfortunaly its not the latest version and the latest version is back in New Zealand on a unpluged HDD. That about 18,000km away!

So what does that mean. Well some dealys anyway. The current code is not "stable" in the sence that the simulation tends to go unstable easily. Even if i keep to all the usual time step limits. There are about 3 different things that it could be, and they will need to be debuged.

But otherwise we continue to make progress. For example we now have a proper object import system. Also moving boundrys are almost there. We are getting some nice previews and it should be quite fast.

Here are a few more movies:
Velocity arrows raster animation
Isosurface of the same animation But cut short.

Monday, February 05, 2007

Current Plan

Quite a lot of progress was made in the weekend. I don't have any screenshots however. Things are really shaping up for a 0.5 beta mid feb (aka ~10 days). Here is a feature milestone outline:

  • Beta 0.5

    • Obstructions

    • non-adaptive time steps

    • Polygon Previews with velocity visualizing

    • Adjustable fluid parameters

  • Beta 0.7

    • Polygon renderings(Could also be used for traingulation of isosurfaces)

    • Adaptive time steps

    • Multitreading fluid solver

    • Limited Moving boundary support

    • Accelerated Isosurface methods and baking

  • Beta 0.9 feature freeze

    • Moving Obstructions

    • Surface tension (for small scale fluids)

    • Scale options

    • Moving fluid source/exit (aka hose end that's moving)

    • Useful presets (like water, honey)

    • Maybe a materials texture for dye and visualization

Going from 0.9 to 1.0 will be just bug fixes. Yea I get bugs in my code sometimes. At this point I'm working on the GUI. Dam I hate GUI's. Last night someone asked why I use the command line for mplayer when watching a DVD, because its easier than trying to find the option you want with clicks.

Thursday, February 01, 2007

Wave Machine...

I remember on TV there was this wave machine where the water is pumped over a surface. Well I thought it would be better to get full on tubes. So here is the first atempt at animating a real wave machine.

Wave Machine

Another polygon preview:


If we look at the last frame and compare a polygon preview with a isosurface render.

So whats going on. Well the last frame took almost 10 mins on a AMD64 X2 5000+ with java64. Thats slow for such a fast machine. This is not so good for debugging so I put some effort into preview visulaizations. So I produce a single axis alginged triangle for each particle. This also includes boundry particles, thats what the stationary ones are. It the first splash you can see them on the surface of the object.

So now with rapid visulaization I should be able to finish this plugin sooner rather than later. But be warned I start my next german course next week so I will be very busy.

Wednesday, January 31, 2007

Previews and Progress

Yes progress! We are looking good for a beta 0.5 version mid to end of Feb. I have added some preview code and got some nice previs without the long render times that we get with Implicit Objects. As you can see in the screen shot we can also now add obstructions and the like.

However one thing is for sure, with the current setup the implcit objects are just too slow. There are two soluctions, one speed up the implicit object evaluations and make some optimization to the implicit code by assuming a smooth function. I want to do both, but we will have to see how things pan out.

Sunday, January 14, 2007

Back from Köln

Yes, we finnaly got out of Veinna for a holiday. Just 3 days and a extra day in Solovakia just to vist the best chocolate shop in the world. So anyway we will be back to work on this today and tommorow.

Friday, January 05, 2007

Boundry condtions

I couldn't sleep last night so I pondered a better way to do boundry condtions. At this point I use the common method of a number of layers of particles attached to the boundry. Unfortunatly this does not really let me import polygon geometry very easily. Or any other type of gemometry for that matter. Another method is reflected particles. Unfortunaly this tends to increase stablity issues with impacting drops since the effective velocity is twice what it should be.

So another way to avoid storing the particles is a "hacked" refelcted boundry particles. Well rather the particles are reflected so that they are on the boundry rather than behind it. Taking this to next simplified step, and the cost of accuracy, we just place a single particle closest to the current particle on the surface, aka perpendicular to the tangent line of the surface. Futher particles can be generated from a stable latice on that surface. Care must be taken at the corners.

Anyway thats not yet implemetened. Here are 2 simulations with differnt thresholds for the surface. Not that one went unstable. I suspect its a threading issue and some particles got updated twice.

treshold=10 and goes unstable

Thursday, January 04, 2007

Art of Illusion

We have started to intergrate the code into art of illusion. If you are like me and havn't heard about AoI then pop over to site. Its a great project and its writen in java which makes intergrating easier than blender. But like all 3d apps its takes getting use to since everything is slightly different. It also has volume rendering which has appeal for smoke effects. And yes I'm still going to put this in blender as well. AoI is great but lacks some of the great modling and animation of blender. But then blender is older and has a lot more people working on it.

I even have some renders from the AoI raytracer and the intergrated fluid engine. Still early stages tho. And note the freck out in one of them when the fluid goes unstable. For those of you that use the blender fluids, just remember its a very easy fluid solver to use, and will problably always be easyer than this one... anyway, the links:

first atempt

faster render

smaller particles

smaller particles and freck out!