I've been working on making a 3D particle system for a class project. It's been going well so far....except for the speed.
At first, I was trying to do 3D objects (cubes), but half of the sides wouldn't be visible (plus, the particles would be small majority of the time unless they were near the camera). So I decided on doing them all in 2D with billboarding, and each object has only 2 triangles to worry about.
With this current setup, I'm getting around 30 fps with 100 objects and 5 fps with 400 objects. Which isn't the most appealing thing, since the game is supposed to have more particles (about 2k).
After checking out the Rajawali's implementation (
http://www.rozengain.com/blog/2012/05/03/rajawali-tutorial-22-more-optimisation/) of a large particle system, I tried to do the same with jPCT (see, I'm not abandoning this engine).
First I was having problems changing the vertices (using the vertexController, still haven't completely got it working :-/) Then I found out that the code to change each particle's transparency/ color would no longer work in this method (because of how vertices share color with each other)
So, what would be the best way to do this system?
Requirements:
- particles which move in 3D space
- each particle has its own position/velocity/color/transparency/life
- many particles (around 2k) with a smooth frame rate
- dynamic creation of particles
Note: The particles don't need any high-quality stuff or collision. Although eventual gravity would be nice, it's on the far back burner.