We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexDiscussionExhibition › Psychedelic fluids and particles
Page Index Toggle Pages: 1
Psychedelic fluids and particles (Read 1002 times)
Psychedelic fluids and particles
May 27th, 2008, 4:32pm
 
http://www.memo.tv/psychedelic_fluids_and_particles_with_processing

no source code for this yet as I wanna tidy it up a bit, but I do have the source code for some other stuff on the site  (which evolved into this).

Its not finished, but I'm going to stop development in processing and switch to C++ for this I'm afraid - I need as many CPU cycles as i can get for this one!!
Re: Psychedelic fluids and particles
Reply #1 - May 27th, 2008, 5:41pm
 
Very nice!
So you hit a limit in Java speed (lot of pixels to manipulate)? Have you tried to compile and run with latest JVM? It is supposed to be faster than 1.4.2.
Not sure if that's enough (but Java people keep repeating that Java can be faster than C++! Wink)
Re: Psychedelic fluids and particles
Reply #2 - May 27th, 2008, 6:41pm
 
Hi PhilHo, yea this is one of those projects where I'm trying to squeeze as much as possible out of the system, even if it means declaring local variables outside of a for loop Smiley

The heaviness comes from lots of pixels yea, but also lots of computations for the fluid simulation, and lots of particles, physics etc.

I'm sure Java can be faster than C++, if the Java app is using a more optimized algorithm! At the moment I'm getting about 25-30fps on my system for this app (when running as a compiled native app), i'm going to do a simple conversion to C++ using the exact same code / algorithms and see the results. Maybe it won't be that different! Maybe it will...

I actually prefer C++ to Java anyway for a project of this complexity - I'm not saying this to start a flame war Smiley, just explaining my rationale for switching to C++ for this project. Like I mention in the post on my site, for getting off the ground quickly Java / Processing is brilliant, I will carry on using it for many projects. But for this one (there's still a lot more features that needs to be added) I prefer having full control over the memory and pointers; using structs over classes when suitable as well as inline functions and macros.

Like I said, i'll be converting the code directly to C++ and will see if and how the performance changes!
Re: Psychedelic fluids and particles
Reply #3 - May 27th, 2008, 6:54pm
 
Personally, I have no religion over programming languages! Smiley
I started as C programmer, did a bit of C++ and Visual Basic (gasp!), and went to Java (also doing stuff in Lua, JavaScript, PHP, and some others...). And they are all nice and useful, with often different goals.
I was mostly curious. Cheesy
Page Index Toggle Pages: 1