Made this last night procrastinating from my exam revision. The blue spheres are ‘gravity wells’ which pull particles in. Red spheres repel particles. If anyone has any idea how I could turn this into some sort of game let me know lol.
Not very well at all. O(particles*gravity wells). I’m rendering 4000 particles here with 30 gravity wells.
I had to do a similar thing for this for one of my final year uni projects, only rendering the scene in 2D through vga manually (lol) and exporting all of the mathematics to an FPGA to speed things up. I was able render 12,000 particles with 50 attractors and 10 walls at 30fps.
Just took a few extra lines of code to port my solution to 3D and make the camera follow one of the particles
Point sprites may make that easier so you only need to setup a single vertex per sphere.
You could alter the default particle emitter I suppose (which already does the triangle movement setup), but I doubt one can set each particle’s location via the influencer system. You’d probably have to take it apart slightly.
Yep, which is still faster than making the GPU draw separate objects. Each geometry is a separate draw call. They are expensive. Get it down to one draw call and you can be a lot faster.
I don’t know what your particles are, though. Personally, I’d have used point sprites so that each one is just one vertex. Maybe you have reasons for making them triangles, though.