Quick 'n Dirty Verlet Fluids v0.1

A Webstart link, for all those lazy bastards out here, eventhough I hate it with a vengeance.
http://www.indiespot.net/files/verlet-liquid.jnlp

There are 8192 particles in this demo. The water has a bit (too much) viscosity, so it will form drops in the air. You can drag the raft around a bit with the mouse. It won’t stay afloat for too long, because the water is flowing very rough. The demo tries to make use of multiple cores, but it still doesn’t manage to use 100% of all 4 cores of my CPU. On my Q6600 I get 50fps, singlethreaded it gives me 25fps.

If you would tell me your FPS (in the titlebar) and your CPU type (and how many cores) it’d be nice!

[quote]If you would tell me your FPS (in the titlebar) and your CPU type (and how many cores) it’d be nice!
[/quote]
Intel 2 core CPU T7500 2.2Ghz - Java 6-u14 - 30/35 fps - 80% of cpu usage

I get between 10 and 15 fps. Using Athlon X2 4000+ (that’s two cores, both being used by the demo).

Edit: It uses 130-140% CPU, and if I minimise the window (so no rendering) then I get around +8 fps.

Thanks for your reports.

I fear I will have to totally rethink the datastructure to improve the performance significantly.

It may be fast enough though for your average simulation.

So… maybe an applet? I’m more lazy that that! :smiley:

<10fps (& jerks a bit) 1 core . Looks nice though, suspect my crud GPU is to blame.

Ha! Applets are infinitely worse! I’d hate to crash your browser.

So… what’s the CPU and what’s the GPU?

[quote]Ha! Applets are infinitely worse! I’d hate to crash your browser.
[/quote]
no no no, and even if Applet + opengl may be worse wich I dont believe is true, webstart sucks even a direct link to an executable jar is better than webstart. NB: I have tested this demo cause it come from you and I wouldn’t have if it was not from a known JGO member.

and sry to be off topic

8-15fps on 3000+ 1.8 ghz single core with 8800GTS 320 MB.

@DzzD

Yeah, let’s not derail it too much. Basically saying that Webstart has major problems, and applets have too. Even these days my browser(s) sometimes crashes on them.

If it makes you happier, the jar the jnlp refers to, is executable:
http://www.indiespot.net/files/verlet-liquid.jar

That’s cool! 28-38fps Intel Core2 2.0Ghz. No different when minimised.

Wish it was an Applet :wink:

thanx for making it a webstart :slight_smile:

minimum FPS: 28
Average FPS: 32

WinXP DualCore E5200 @ 2.50Ghz
2GB ram

do you have any gaming plans for the physics?

I get about 35FS on a dual core T7500 2.2Ghz, 8700M GT graphics.

About 50fps here with a Core 2 Duo @ 3Ghz. Looks really cool, very turbulent. ;D

Around 30-40 FPS on a MacBook with a 2.1 Ghz Core 2 Duo.

Nah, I’m not really artistic, nor creative for that matter. I love to do designing and optimising, but don’t expect me to release something playable.

Wow, well, it seems like the algorithm still takes more advantage of the clockspeed than the amount of cores.

The turbulence is just a side effect if the integrator, not really hard work :slight_smile: Another nice thing is that the current algorithm works in 3D too - I’d only have to change 1 line of code - basically assigning a z-value (instead of 0.0) to every drop and watch it go. I’m just not really into writing a 3D renderer in Java2D, and going to LWJGL is a bit out of scope of this probject.

The only problem with the current algorithm is that large liquid bodies tend to get unstable at the bottom, due to the massive stress and conflicting constraints. The problem is that I can’t relax the collision response (or releasing tension of springs), because then the liquid becomes compressable, which causes ‘global resonation’ - the fluid falls in on itself, then explodes, in an infinte loop - besides that, real fluids are not compressible anyway, so relaxing is not how I should be solving the stress problem anyway. I already slightly hacked the verlet code to handle fluids differently from your average sphere/sphere collision, but there are still some drops shooting out like fireworks.

Vista64, about 70fps, 8 cores (i7), uses about 30% CPU - think it’s the 32bit VM though.

Cas :slight_smile:

Eight virtual cores (hyper threading) I guess?

I hope that Runtime.getRuntime().availableProcessors() returns 8 in this case.

I also have Vista64, and there is no fps difference between the 32 and 64 bit JRE in this demo, it only uses a bit more memory due to the larger pointer size.

Cool demo, 35 fps running at 85% on a dual core intel 2.16gHz laptop, 3GB RAM, NVidia 8600 GPU.

Reminds me of that sand, water and elements games where you burn up the sand.

Except that those games have very bad physics :slight_smile: They are only acceptable because the gameplay is so much fun!

True, my little brother spent ages on those games - i never understood why because there was no objective at all but he liked it.

So let us in on how your verlet physics works - does it use circles or squares for collisions? 8000+ things colliding with each other is quite a lot.

And is most of the CPU time spent doing physics or rendering because I notice that the window is pretty big