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
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
, 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!